IOExts.slurpFile fails on zero-length files

Simon Marlow simonmar at microsoft.com
Thu May 9 05:07:31 EDT 2002


> Unluckily it doesn't look easy to make 'hGetBuf' fail more gracefully
> (you could read 0 bytes after all), because then still the
> 'mallocBytes 0' in 'slurpFile' will probably fail 

How about: hGetBuf with an argument of zero returns trivially with zero,
and slurpFile on a file with size zero returns (nullPtr, 0)?

Cheers,
	Simon



More information about the Glasgow-haskell-bugs mailing list