The command file.read is used to read an open file.
- handle [integer]
Handle of the opened file.
- size [integer]
Number of bytes to be read.
- variablebuffer [string]
Hexadecimal of the content of read bytes.
- variablereturn [integer]
Number of read bytes.
In the example above the file test.txt has been downloaded using the command downloadfile. The file test.txt has been opened for reading (r) using the command file.open
Note that to find the file size in bytes, for use by the command file.read, we use the command filesystem.filesize.
The result of file.read will be displayed on the display.