On Thu, 05 Mar 2009 19:56:42 +0100, Anish Muttreja <anishmuttr...@gmail.com> wrote:

I am looking for a way to test if a file is empty.
Something like isFileEmpty along the lines of
System.Directory.doesFileExist?

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

Searching for "size" with Hoogle lead me to System.IO.hFileSize:
  hFileSize :: Handle -> IO Integer
For a handle hdl which attached to a physical file, hFileSize hdl returns the size of that file in 8-bit bytes.

--
Regards,
Henk-Jan van Tuyl


--
http://functor.bamikanarie.com
http://Van.Tuyl.eu/
--


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to