in reply to Problems using Filesys::DiskFree
Ronnie,
To paraphraase the man page for this module:
Notice the assignment of the variable $handle. This is important. In order to reference something it has to exist. Now when I run the code on my Linux box on my desk at work I get:#!/usr/bin/perl -w ###################################### use strict; use warnings; use Filesys::DiskFree; my $handle = new Filesys::DiskFree; # ASSIGN HANDLE! $handle->df(); print "The root device is ".$handle->device("/")."\n"; print "It has ".$handle->avail("/")." bytes available\n"; print "It has ".$handle->total("/")." bytes total\n"; print "It has ".$handle->used("/")." bytes used\n";
The root device is /dev/hda1 It has 669364224 bytes available It has 9253654528 bytes total It has 8114221056 bytes used
Hope this helps.
| Peter L. Berghold -- Unix Professional Peter at Berghold dot Net | |
| Dog trainer, dog agility exhibitor, brewer of fine Belgian style ales. Happiness is a warm, tired, contented dog curled up at your side and a good Belgian ale in your chalice. | |
|
|---|