Filesys::DiskSpace - Perl df
use Filesys::DiskSpace; ($fs_type, $fs_desc, $used, $avail, $fused, $favail) = df $dir;
This routine displays information on a file system such as its type, the amount of disk space occupied, the total disk space and the number of inodes. It tries syscall(SYS_statfs) and syscall(SYS_statvfs) in several ways. If all fails, it croaks.
syscall(SYS_statfs)
syscall(SYS_statvfs)
croak
[number] type of the filesystem.
[string] description of this fs.
[number] size used (in Kb).
[number] size available (in Kb).
[number] free inodes.
[number] inodes used.
See the INSTALL file.
Copyright (c) 1996-1999 Fabien Tassin. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Fabien Tassin <fta@oleane.net>
This module was formerly called File::Df. It has been renamed into Filesys::DiskSpace. It could have be Filesys::Df but unfortunatly another module created in the meantime uses this name.
Tested with Perl 5.003 under these systems :
- Solaris 2.[4/5] - SunOS 4.1.[2/3/4] - HP-UX 9.05, 10.[1/20] (see below) - OSF1 3.2, 4.0 - Linux 2.0.*, 2.2.*
Note for HP-UX users :
if you obtain this message : "Undefined subroutine &main::SYS_statfs called at Filesys/DiskSpace.pm line XXX" and if you are using a hp9000s700, then edit the syscall.ph file (in the Perl lib tree) and copy the line containing "SYS_statfs {196;}" outside the "if (defined &__hp9000s800)" block (around line 356).
To install Filesys::DiskSpace, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Filesys::DiskSpace
CPAN shell
perl -MCPAN -e shell install Filesys::DiskSpace
For more information on module installation, please visit the detailed CPAN module installation guide.