lua-users home
lua-l archive

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


I'm trying to open and write a file in binary mode but openfile seems to be ignoring my 'b' specification.

I'm assuming the following code should work?

  out = openfile("out", "w+b")
  write(out, 9999)

writes the string 9999 to out

Or am I misunderstanding something?

I would guess that write would write the value as a string if I passed a string, the number value in binary if I passed a number.