• 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
Detect free space
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Detect free space


  • Subject: Detect free space
  • From: "Jan E. Schotsman" <email@hidden>
  • Date: Sat, 14 May 2005 09:08:24 +0200

Hello list,

This may be somewhat OT but I have already asked on the Carbon-dev list in vain. Maybe someone here has some advice.

I have a problem detecting free space on an XSan volume.
This code:

		error	=	FSAllocateFork( fileRefNum,
										kFSAllocAllOrNothingMask, fsFromStart, 0, neededSize, nil );

returns -34 (disk full)

I then tried

error = FSAllocateFork( fileRefNum, 0, fsFromStart, 0, neededSize, &actualCount );
Now I still get -34 but actualCount = neededSize !!


If I hadn't set actualCount to nil in the first call it might have returned the requested amount too, I suppose.
Ample free space is available actually.
One would expect an Apple file system to be able to handle FSAllocateFork calls!


Anyway, what is the best strategy to find out about free space, either on local or network volumes, any file system?
First try FSGetVolumeInfo, if this fails FSAllocateFork, or the other way around? Let actualCount override the error?


Confused,

Jan.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Detect free space
      • From: Peter Bierman <email@hidden>
  • Prev by Date: Doing synchronous writes from a stream's callback
  • Next by Date: Changing IP Address and Config method using the System configurat ion framework.
  • Previous by thread: Doing synchronous writes from a stream's callback
  • Next by thread: Re: Detect free space
  • Index(es):
    • Date
    • Thread