RE: Pure Perl df

From: Luke Bakken (Luke.Bakken_at_getronics.com)
Date: 12/30/03


Date: Tue, 30 Dec 2003 13:56:05 -0800
To: "James Edward Gray II" <james@grayproductions.net>,	"perlgroup List" <beginners@perl.org>


> 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:
http://www.openbsd.org/cgi-bin/cvsweb/src/bin/df/df.c?rev=1.37&content-t
ype=text/x-cvsweb-markup

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
> vary.

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.

Luke



Relevant Pages

  • Pure Perl df
    ... I'm at a loss and need help. ... A friend of mine is working with a ... Perl script. ... HP-UX, Solaris, Linux, and Windows. ...
    (perl.beginners)
  • Re: Vista - stillborn?
    ... I doubt you consider me a friend. ... If there is any hostility, it is definitely not on my part, I assure you. ... Windows posters don't use any such language. ... "xxx Fanatic" doesn't fit the kind of people commonly ...
    (comp.sys.mac.advocacy)
  • Dual-boot w/ME vs. XP vs. W98se
    ... I have a friend that is currently dual-booting Debian Sarge with Windows ... 'bought and paid for' by Microsoft. ... " Bill Turner ...
    (Debian-User)
  • Re: Windows 2000 vs. XP Home Edition ?
    ... myself in a discussion with a friend... ... I was insisting that Windows 2000 came out in two flavors for client ... background in I/T and was so confident in the truth of my conviction. ... to think that doing this amounted to downgrading my operating system. ...
    (microsoft.public.win2000.general)
  • Re: opinions about MS Vista
    ... I just received an email from a friend (Actually he is a windows lover). ... He attended a session organized by Microsoft to introduce the most recent ... Tell your mom to remind you to switch on your computer at a specified time. ...
    (Ubuntu)