Re: Getting information about volumes
Re: Getting information about volumes
- Subject: Re: Getting information about volumes
- From: Greg Robbins <email@hidden>
- Date: Wed, 5 Mar 2003 12:13:53 -0800
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.