Re: Detecting low disk space
Re: Detecting low disk space
- Subject: Re: Detecting low disk space
- From: Shawn Erickson <email@hidden>
- Date: Fri, 9 Apr 2004 08:37:20 -0700
On Apr 9, 2004, at 3:03 AM, Peter wrote:
Hello,
I have an app which sometimes generate a very large files and hits a
write error when the disk space is low at start up hard disk. It is
hard to tell whether the disk space is enough, although sometimes it
display as certain of megabytes left in free disk space but it is not
enough for my app. My guess is the OS X's virtual memory is also taken
up part of the disk space but not displayed.
My question is there a way to detect low disk space or 'true' disk
space left ?
Thanks in advance.
Programatic API exist for this but I would have to dig for them but
consider using the output of the tool "df".
[G5:~] shawnce% df -k -l
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/disk1s9 245097216 92430676 152410540 38% /
/dev/disk0s9 245097216 84331220 160765996 34%
/Volumes/Internal_250GB_2
/dev/disk2s2 4589304 3643576 945728 79% /Volumes/Unreal
Tournament 2004 for MacOS X
/dev/disk3s2 103384 82076 21308 79% /Volumes/iDisk
/dev/disk4 588708 587884 824 100% /Volumes/Command &
Conquer Generals Demo
Of course because of links and mount points it can be hard to tell what
disk you may be targeting without little extra work.
-Shawn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.