[Haskell-cafe] Test if a file is empty or stat in haskell
Anish Muttreja
anishmuttreja at gmail.com
Thu Mar 5 14:24:46 EST 2009
On Thu, Mar 05, 2009 at 08:15:03PM +0100, Daniel Fischer wrote:
> 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 ...
Great, thanks.
> dunno if Windows has similar functionality.
I am on Linux. BTW, Hoogle does not seem to know about
System.Posix.Files, though it did point me to System.IO.FileSize
which would also have served the purpose.
http://www.haskell.org/hoogle/?hoogle=fileSize
Thanks,
Anish
>
> >
> > 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