On Wed, 31 Dec 2003 12:02:27 GMT,
Brian Greenfield <not-for-> wrote:
> I was writing a script that needed to find the free space on a mounted
> Linux partition (mounted on /backup) and I wrote the following
> snippet:
[snip]
Apart from all the other suggestions you've had about parsing df output
(and mind that it can get quite complicated to do that reliably), and to
read the /proc file system directly, there is the Filesys:

f module,
available from CPAN, which is a wrapper wround Filesys::Statvfs, which
is a wrapper around your system's statvfs call.
Using that will probably make your program more portable (to all
environments where statvfs is available, which includes linux, and all
major unices I know of), give you more information when needed, and most
likely is a lot faster and lighter on the machine as well.
Apart from that, there are also Filesys:

iskFree (runs external df
command), and Filesys:

iskSpace (calls statvfs), neither of which I've
tried.
Martien
--
|
Martien Verbruggen | Little girls, like butterflies, need no
| excuse - Lazarus Long
|