[Haskell-cafe] listing mountpoints and getting their properties in Haskell

Vasyl Pasternak vasyl.pasternak at gmail.com
Sat Feb 27 18:11:44 EST 2010


The only Linux function that can do this is `statvfs`. But binding to
it weren't implemented in the current libraries.

Year ago I implemented function that queries free size of the mounted
filesystem. The file is attached. To get other parameters you should
only extend `peek` function of the `Storable` class.

Hope it helps.


2010/2/27 Eugene Dzhurinsky <bofh at redwerk.com>:
> Hello!
> I need to list all currently mounted filesystems and get some stats like
> total space, free space, mount point and physical device.
> Is there any library capable of obtaining such information from OS itself?
> Parsing output of 'df' is locale-dependent and error-prone (because of locale
> settings, output settings etc).
> Thank you in advance.
> --
> Eugene N Dzhurinsky
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: statvfs.hsc
Type: application/octet-stream
Size: 1130 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20100227/7121088e/statvfs.obj

More information about the Haskell-Cafe mailing list