read_lines
Description:
[ CCode ( array_length = false , array_null_terminated = true ) ]
[ Version ( since = "0.7" ) ]
public string[] read_lines (string path) throws Error
[ Version ( since = "0.7" ) ]
public string[] read_lines (string path) throws Error
read file as lines
Return the contents of the file named path
.
The file contents are returned as a list of lines. Trailing LF
and CRLF
character sequences are *not* returned.
Note that this function cannot correctly handle binary files (specifically, files containing "\0" character which is treated as end of string). For those you need to use the read_file function and split the buffer into lines yourself.
Parameters:
this |
A GuestfsSession object |
Returns:
an array of returned strings, or NULL on error |