Thread Free Disk Space? (2 answers)
Opened by Gast at 2007-07-15 14:07

topeg
 2007-07-15 22:10
#78507 #78507
User since
2006-07-10
2611 Artikel
BenutzerIn

user image
Für Linux:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl

use strict;
use warnings;

my $buf = "\0"x64;
my $path = "/";
if(syscall(99, $path, $buf) == 0)
{
   my ($bsize, $blocks, $bfree, $bavail, $files, $ffree, $namelen) = unpack("x4 L6 x8 L", $buf);
   print "Blocksize: $bsize; Blocks: $blocks; -->; Size:".$bsize*$blocks."\n";
   print "Blocksfree: $bfree; -->; Free: ".$bfree*$bsize."\n";
}
else
{ print "syscall(statfs) error!\n"; }

View full thread Free Disk Space?