#!/usr/local/bin/perl

# $Id: fs_stat,v 1.4 2005/09/08 22:04:57 abh Exp $

$CMDuname    = '/bin/uname';
chop($systyp = `$CMDuname`);  # used for processing df command
$DFop = ($systyp eq 'Linux' ? '-P' : '');

     if (-x '/bin/df')      {$DF = "/bin/df $DFop";}
  elsif (-x '/usr/bin/df')  {$DF = "/usr/bin/df $DFop";}
  elsif (-x '/usr/sbin/df') {$DF = "/usr/sbin/df $DFop";}
  else {exit(255);}

$path = $ARGV[0];
@resp = `$DF -k $path`;
exit($?) if ($?);

(@toks) = split(' ', $resp[1]);
$freespace = $toks[3] * 1024;
print $freespace, " 0\n";
exit(0);
