lua-users home
lua-l archive

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


On Wed, Dec 29, 2010 at 7:01 AM, starwing <weasley.wx@gmail.com> wrote:
> I use gzio for binary data save and restore. but I fount I can't read
> a whole file that I have just written into file!
...
> gzFile = assert(gzio.open(filename..".gz", "w"))
...
> gzFile = assert(gzio.open(filename..".gz", "r"), "gzio.open failed!")
...
> It's strange, but I'm on Windows now, can't compile a dll and debug,
> has anybody found this issue before?

If you're reading or writing binary files on Windows, then you should
have "b" in your mode string, as otherwise magic happens (bad magic in
this case).