• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Detecting low disk space
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting low disk space


  • Subject: Re: Detecting low disk space
  • From: Fritz Anderson <email@hidden>
  • Date: Fri, 9 Apr 2004 10:48:19 -0500

NSDictionary * dict = [[NSFileManager defaultManager] fileSystemAttributesAtPath: @"/"];
unsigned freeSpace = [[dict objectForKey: NSFileSystemFreeSize] unsignedIntValue];

This will give you the free disk space on the startup volume. I can't vouch for whether it is wise (or possible) to take up all the free space.

-- F

On 9 Apr 2004, at 5:03 AM, Peter wrote:

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 ?
_______________________________________________
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.


References: 
 >Detecting low disk space (From: Peter <email@hidden>)

  • Prev by Date: Re: Detecting low disk space
  • Next by Date: Re: Send Email with "deliverMessage"
  • Previous by thread: Re: Detecting low disk space
  • Next by thread: Re: Detecting low disk space
  • Index(es):
    • Date
    • Thread