lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> Is read() known to work with binary files?

Currently, "read()" is known *not* to work with binary files, because it
returns a string, and a string cannot have a binary value 0. Therefore,
whenever the binary file has a 0, we have a problem.

  The next version of Lua (3.1, not alpha) supports strings with arbitrary
binary values (that is, they may have 0's inside them), and therefore will be
able to read (and write) binary files.


> Is read(".") the right way to get a single byte out of a binary file?

It will be.


-- Roberto