Reads the entire contents of a file as a byte array.
Example:
var path = new Path ("/tmp/data.bin");
uint8[]? data = Files.readBytes (path);
if (data != null) {
print ("Read %d bytes\n", data.length);
}
| path |
path to the file. |
|
the file contents as a byte array, or null on error. |