Filesys::DfPortable 0.85
Sponsored Links
Filesys::DfPortable 0.85 Ranking & Summary
File size:
0.007 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
912
Date added:
2007-04-27
Publisher:
Ian Guthrie
Filesys::DfPortable 0.85 description
Filesys::DfPortable is a Perl extension for filesystem disk space information.
SYNOPSIS
use Filesys::DfPortable;
my $ref = dfportable("C:"); # Default block size is 1, which outputs bytes
if(defined($ref)) {
print"Total bytes: $ref->{blocks}n";
print"Total bytes free: $ref->{bfree}n";
print"Total bytes avail to me: $ref->{bavail}n";
print"Total bytes used: $ref->{bused}n";
print"Percent full: $ref->{per}n"
}
my $ref = dfportable("/tmp", 1024); # Display output in 1K blocks
if(defined($ref)) {
print"Total 1k blocks: $ref->{blocks}n";
print"Total 1k blocks free: $ref->{bfree}n";
print"Total 1k blocks avail to me: $ref->{bavail}n";
print"Total 1k blocks used: $ref->{bused}n";
print"Percent full: $ref->{per}n"
}
This module provides a portable way to obtain filesystem disk space information.
The module should work with all versions of Windows (95 and up), and with all flavors of Unix that implement the statvfs or the statfs calls. This would include Linux, *BSD, HP-UX, AIX, Solaris, Mac OS X, Irix, Cygwin, etc ...
This module differs from Filesys::Df in that it has added support for Windows, but does not support open filehandles as a argument.
dfportable() requires a directory argument that represents the filesystem you want to query. There is also an optional block size argument so that you can tailor the size of the values returned. The default block size is 1, this will cause the function to return the values in bytes. If you never use the block size argument, then you can think of any instance of "blocks" in this document to really mean "bytes".
dfportable() returns a reference to a hash. The keys available in the hash are as follows:
{blocks} = Total blocks on the filesystem.
{bfree} = Total blocks free on the filesystem.
{bavail} = Total blocks available to the user executing the Perl application. This can be different than {bfree} if you have per-user quotas on the filesystem, or if the super user has a reserved amount. {bavail} can also be a negative value because of this. For instance if there is more space being used then you have available to you.
{bused} = Total blocks used on the filesystem.
{per} = Percent of disk space used. This is based on the disk space available to the user executing the application. In other words, if the filesystem has 10% of its space reserved for the superuser, then the percent used can go up to 110%.
You can obtain inode information through the module as well. But you must call exists() on the {files} key to make sure the information is available. Some filesystems may not return inode information, for example Windows, and some NFS filesystems.
Here are the available inode keys:
{files} = Total inodes on the filesystem.
{ffree} = Total inodes free on the filesystem.
{favail} = Total inodes available to the user executing the application. See the rules for the {bavail} key.
{fused} = Total inodes used on the filesystem.
{fper} = Percent of inodes used on the filesystem. See rules for the {per} key.
If the dfportable() call fails for any reason, it will return undef. This will probably happen if you do anything crazy like try to get information for /proc, or if you pass an invalid filesystem name, or if there is an internal error. dfportable() will croak() if you pass it a undefined value.
SYNOPSIS
use Filesys::DfPortable;
my $ref = dfportable("C:"); # Default block size is 1, which outputs bytes
if(defined($ref)) {
print"Total bytes: $ref->{blocks}n";
print"Total bytes free: $ref->{bfree}n";
print"Total bytes avail to me: $ref->{bavail}n";
print"Total bytes used: $ref->{bused}n";
print"Percent full: $ref->{per}n"
}
my $ref = dfportable("/tmp", 1024); # Display output in 1K blocks
if(defined($ref)) {
print"Total 1k blocks: $ref->{blocks}n";
print"Total 1k blocks free: $ref->{bfree}n";
print"Total 1k blocks avail to me: $ref->{bavail}n";
print"Total 1k blocks used: $ref->{bused}n";
print"Percent full: $ref->{per}n"
}
This module provides a portable way to obtain filesystem disk space information.
The module should work with all versions of Windows (95 and up), and with all flavors of Unix that implement the statvfs or the statfs calls. This would include Linux, *BSD, HP-UX, AIX, Solaris, Mac OS X, Irix, Cygwin, etc ...
This module differs from Filesys::Df in that it has added support for Windows, but does not support open filehandles as a argument.
dfportable() requires a directory argument that represents the filesystem you want to query. There is also an optional block size argument so that you can tailor the size of the values returned. The default block size is 1, this will cause the function to return the values in bytes. If you never use the block size argument, then you can think of any instance of "blocks" in this document to really mean "bytes".
dfportable() returns a reference to a hash. The keys available in the hash are as follows:
{blocks} = Total blocks on the filesystem.
{bfree} = Total blocks free on the filesystem.
{bavail} = Total blocks available to the user executing the Perl application. This can be different than {bfree} if you have per-user quotas on the filesystem, or if the super user has a reserved amount. {bavail} can also be a negative value because of this. For instance if there is more space being used then you have available to you.
{bused} = Total blocks used on the filesystem.
{per} = Percent of disk space used. This is based on the disk space available to the user executing the application. In other words, if the filesystem has 10% of its space reserved for the superuser, then the percent used can go up to 110%.
You can obtain inode information through the module as well. But you must call exists() on the {files} key to make sure the information is available. Some filesystems may not return inode information, for example Windows, and some NFS filesystems.
Here are the available inode keys:
{files} = Total inodes on the filesystem.
{ffree} = Total inodes free on the filesystem.
{favail} = Total inodes available to the user executing the application. See the rules for the {bavail} key.
{fused} = Total inodes used on the filesystem.
{fper} = Percent of inodes used on the filesystem. See rules for the {per} key.
If the dfportable() call fails for any reason, it will return undef. This will probably happen if you do anything crazy like try to get information for /proc, or if you pass an invalid filesystem name, or if there is an internal error. dfportable() will croak() if you pass it a undefined value.
Filesys::DfPortable 0.85 Screenshot
Filesys::DfPortable 0.85 Keywords
DfPortable
Total 1k
DfPortable 0.85
1k
disk space information
disk space
space information
perl extension
available to
Block size
total
filesystem
blocks
print
n
information
Bookmark Filesys::DfPortable 0.85
Filesys::DfPortable 0.85 Copyright
WareSeeker periodically updates pricing and software information of Filesys::DfPortable 0.85 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Filesys::DfPortable 0.85 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
linux disk space information
disk space narrowing
block
disk space recovery
disk space analyzer
disk space manager
low disk space
drive c insufficient free disk space
disk space vista
disk space report
disk space recovery wizard
disk space linux
hard disk space
disk free space
linux free disk space information
disk space usage
information they need
printers
Related Software
Filesys::DiskSpace is a Perl module as a df replacement. Free Download
Filesys::Df is a Perl extension for filesystem disk space information. Free Download
Filesys::DiskFree is a Perl module to perform the Unix command df in a portable fashion. Free Download
Filesys::Statvfs is a Perl extension for statvfs() and fstatvfs(). Free Download
Filesys::DiskUsage is a Perl module to estimate file space usage (similar to `du`). Free Download
Filesys::SamFS is a Perl extension mapping the SamFS API to Perl. Free Download
Filesys::Ext2 is a Perl interface to ext2 and ext3 filesystem attributes. Free Download
Filesys::SmbClient is a Perl interface for access Samba filesystem with libsmclient.so Free Download
Latest Software
Popular Software
Favourite Software