lua-users home
lua-l archive

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


Dear Lua community,

Why does the following code not write anything to the file on Windows?

  local f = io.open( "write13.bin", "wb" )

  if f then
    f:write( string.format( "%c", 13 ) ) -- outputs nothing.

    f:close()
  end

Note: this works fine with the stock Lua binary on FreeBSD.  It's only
on Windows that this fails, and puts nothing in the file.  Both with
my own compiled Lua, using Open Watcom 1.9, and the Lua Binaries down-
load from sourceforge.

I know the number 13 is supposed to be unlucky, but this is a bit
ridiculous.  Why is it special?

I did not find any bug reports relevant to this, nor prior posts in
the mailing list archives.


Thank you,
Johann

P.S.  If this gets listed on the bugs page, please use "reported by
myrkraverk."