On Thu, Nov 20, 2008 at 10:15:06 +0100, Matthias Andree wrote:
> 2. gzip </dev/null is not the equivalent of gzwrite(foo, bar, 0). The
>    zlib equivalent would rather be opening a file for write and closing
>    it right again.
> 
>    The actual problem is that there are subtle differences for 0-sized
>    writes in the gzwrite() interface as compared to write().
>    gzwrite(), as write(), returns the number of bytes successfully
>    written. Unlike write() however, gzwrite() uses 0 (rather than EOF
>    that is used by write(), and EOF is usually -1) to indicate error.
> 
>    So with gzwrite() you cannot distinguish "successfully written 0
>    bytes" from "error writing 0 bytes".

That was very helpful.  Thanks much!

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9

Attachment: signature.asc
Description: Digital signature

_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to