RE: Pure Perl df
From: Luke Bakken (Luke.Bakken_at_getronics.com)
Date: Tue, 30 Dec 2003 13:56:05 -0800 To: "James Edward Gray II" <firstname.lastname@example.org>, "perlgroup List" <email@example.com>
> Okay, I'm at a loss and need help. A friend of mine is
> working with a
> Perl script. It has a system call to df in it, he would like to
> replace with something a little more portable.
Well, looking here at the source to df on OpenBSD:
it looks as though it uses getmntinfo() to get information about free
space. This function call may be implemented in some perl module, or you
could be brave and use syscall() to call it. I'll work on that for kicks
and get back to the list. Your friend will have to see if this function
exists on all his unix platforms.
> The script is used in a 32 server environment that I know has
> at least
> four operating systems: HP-UX, Solaris, Linux, and Windows.
> I believe
> df is pretty standard on all of those but Windows, though the options
On Windows, I'd use Win32::DriveInfo
> So the questions: Is there a pure Perl way to handle a
> df-like call?
> Is there an equivalent program in the Windows world? Any other tips?
> I browsed the CPAN a bit, but wasn't too happy with the
> choices there,
> aside from the fact that any module installs would pretty much defeat
> the purpose here.
Why is that? That is the point of modules.