[Haskell-cafe] Test if a file is empty or stat in haskell

Daniel Fischer daniel.is.fischer at web.de
Thu Mar 5 14:15:03 EST 2009


Am Donnerstag, 5. März 2009 19:56 schrieb Anish Muttreja:
> I am looking for a way to test if a file is empty.
> Something like isFileEmpty along the lines of
> System.Directory.doesFileExist?

If you're on a *nixy OS, 
System.Posix.Files

getFileStatus, fileSize ...

dunno if Windows has similar functionality.

>
> A function that wraps stat would also serve the purpose.
> I get the feeling that someone must have felt the need for this before
> me, but Google search not yield anything, hence the question.
>
> Thanks!
> Anish



More information about the Haskell-Cafe mailing list