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);
}
| path |
path to the file. |
|
the file contents as a string, or null on error. |