Extracted from Pike v7.3 release 53 at 2002-09-10.
pike.ida.liu.se
[Top]
Stdio

Method Stdio.read_bytes()


Method read_bytes

string Stdio.read_bytes(string filename, int start, int len)
string Stdio.read_bytes(string filename, int start)
string Stdio.read_bytes(string filename)

Description

Read len number of bytes from the file filename starting at byte start, and return it as a string.

If len is omitted, the rest of the file will be returned.

If start is also omitted, the entire file will be returned.

Throws

Throws an error if filename isn't a regular file.

Returns

Returns 0 (zero) on failure to open filename.

Returns a string with the requested data otherwise.

See also

Stdio.read_file, Stdio.write_file, Stdio.append_file