readAllText


Description:

public static string? readAllText (Path path)

Reads the entire contents of a file as a string.

Example:

    var path = new Path ("/tmp/file.txt");
string? text = Files.readAllText (path);
if (text != null) {
print ("%s\n", text);
}

Parameters:

path

path to the file.

Returns:

the file contents as a string, or null on error.