[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: gzio read file fault & example program error.
- From: Peter Cawley <lua@...>
- Date: Wed, 29 Dec 2010 16:48:23 +0000
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).