in reply to Portably get disk free information

I'd always prefer a module solution over directly accessing a system command. So it is easier to create a workaround solution for a platform, which e.g. has another df format or no df at all. I think you should be comfortable with Filesys::DiskFree, and if you ever hit a platform where it does not work you could tell the author about it or provide a patch yourself.

Replies are listed 'Best First'.
Help with Filesys::DiskFree (and Re: Re: Portably get disk free information)
by bronto (Priest) on Apr 20, 2004 at 16:49 UTC

    Well, unfortunately Filesys::DiskFree relies on the underlying df command, so you are indeed accessing a system command that the module is using on your behalf. Moreover, the docs talk about "blocks" when talking about the set method, and "bytes" everywhere else.

    At the moment I can test it just on Linux and Solaris 9, so I can't tell if it always returns sizes in bytes or if it returns sizes in blocks on some OS. Could anybody please test it on some other platform and tell me if it returns blocks instead of bytes somewhere?

    Thanks in advance

    Ciao!
    --bronto


    The very nature of Perl to be like natural language--inconsistant and full of dwim and special cases--makes it impossible to know it all without simply memorizing the documentation (which is not complete or totally correct anyway).
    --John M. Dlugosz