Might it be more efficient to bypass counting altogether, and just use the Haskell version of stat? getFileSize :: FilePath -> IO Int64 getFileSize path = do stat <- getFileStatus path let COff fs = fileSize stat return fs Peace, Stu