[Haskell-cafe] Filesystem access

Bulat Ziganshin bulat.ziganshin at gmail.com
Fri Jun 22 02:50:27 EDT 2007

Hello Andrew,

Friday, June 22, 2007, 12:19:51 AM, you wrote:
> 1. Is there *any* way to determine how large a file is *without* opening
> it? The only library function I can find to do with file sizes is 
> hFileSize; obviously this only works for files that you have permission
> to open!

std library doesn't contain such function, although it is easily
modeled after getModificationTime. note that on windows this will
return only lower 32 bits of file size due to using lstat() internally

another way around this is to look at getFileAttributes implementation
and build the same wrapper around win32 getfilesize function

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list