Method Stdio.read_file()
- Method read_file
string
read_file(string
filename
)
string
read_file(string
filename
,int
start
,int
len
)- Description
Read
len
lines from a regular filefilename
after skippingstart
lines and return those lines as a string. If bothstart
andlen
are omitted the whole file is read.- Throws
Throws an error on any I/O error except when the file doesn't exist.
- Returns
Returns
0
(zero) if the file doesn't exist or ifstart
is beyond the end of it.Returns a string with the requested data otherwise.
- See also