Re: Getting information about volumes
Re: Getting information about volumes
- Subject: Re: Getting information about volumes
- From: Dan Bernstein <cocoa-dev%email@hidden>
- Date: Wed, 5 Mar 2003 22:49:12 +0200
Thanks. I guessed I'd have to use the Carbon File Manager, but one can
hope.
-- Dan
On Wednesday, March 5, 2003, at 10:13 PM, Greg Robbins wrote:
What's the best way to:
1. Given a path to a file, determine the volume it resides on
(preferably without being confused by symlinks or aliases).
Use FSPathMakeRef to get an FSRef for the file, then call
FSGetCatalogInfo asking for kFSCatInfoVolume to get the FSVolumeRefNum
for the volume.
Bear in mind that FSRefs only exist for files and directories that
currently exist.
2. Given some identification of a volume (obtained by 1.) to
determine how much free disk space there is on that volume.
Call FSGetVolumeInfo.
The sample code MoreFilesX shows how to do these in its routines
FSGetVRefNum and FSGetVInfo.
<http://developer.apple.com/samplecode/Sample_Code/Files/
MoreFilesX.htm>
Greg Robbins
_______________________________________________
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.
_______________________________________________
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.