Left for archival purposes.

User avatar
By Markus Gritsch
#5689 Hi,

currently, the file module only has a readline() function to read one line of text.

It would be nice to have a file.read() function, to read non-text files. Maybe the amount of bytes to read should be given as a parameter to the read() function.
User avatar
By Markus Gritsch
#6552 From reading the current NodeMcu source code I see that this has already been implemented:

// Lua: read()
// file.read() will read all byte in file
// file.read(10) will read 10 byte from file, or EOF is reached.
// file.read('q') will read until 'q' or EOF is reached.

Thanks a lot!