[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Determining free disk space



On Mon, Oct 11, 1999 at 10:34:29AM +0200, Ian wrote:
} Hi
} 
} I've had a look at CPAN, the FAQ, and searched the mailing list archive, but
} with no joy. I'd like to write a simple script that runs as a cron job and
} checks the space remaining on all the volumes on our server...if there's
} less than a certain amount of space on one of the volumes it'll email the
} sysadmin with the details.
} 
} However, I can't find a way of finding out how much free space there is on a
} mounted (or local) volume. There are a couple of Unix modules for this, but
} evidently not for the Mac. Any clues?

You could use File::Find to laboriously walk the tree and total up the
size of every file it found.  But if I were you, I'd be hunting
through "Inside Macintosh" and the Mac Toolbox pods with Shuck to find
the call it uses to give you the total disk usage when you "command-I"
a disk.  That seems to be instantaneous, even on a netatalk mounted
disk on the Linux machine.  Then, if MacPerl gives you access to that
routine, the problem is solved.

} 
} Thanks, Ian
} 
} # ===== Want to unsubscribe from this list?
} # ===== Send mail with body "unsubscribe" to macperl-request@macperl.org
} 

-- 
Paul Schinder
schinder@pobox.com

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org