| Tie-DiskUsage documentation | view source | Contained in the Tie-DiskUsage distribution. |
Tie::DiskUsage - Tie disk usage to a hash
use Tie::DiskUsage;
tie %usage, 'Tie::DiskUsage', '/var', '-h';
print $usage{'/var/log'};
untie %usage;
Tie::DiskUsage ties the disk usage, which is extracted from the output
of du(1), to a hash. If the path to perform the du command on is undef,
the current working directory will be examined; options to du may be
passed at the end of the tie invocation with a string provided per option.
By default, the location of the du command is assumed to be at /usr/bin/du;
if du cannot be found there, File::Which will attempt to gather its real
location.
The default path to du may be overridden by setting the global
$Tie::DiskUsage::DU_BIN (usually not needed due to File::Which's
automatic search for du).
Processing output of du(1) requires that each output line is ended
by a newline.
tie in perlfunc, du(1), Filesys::DiskUsage, Sys::Statistics::Linux
Steven Schubiger <schubiger@cpan.org>
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
| Tie-DiskUsage documentation | view source | Contained in the Tie-DiskUsage distribution. |