• 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: Getting information about volumes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Getting information about volumes
      • From: Dan Bernstein <cocoa-dev%email@hidden>
References: 
 >Getting information about volumes (From: Dan Bernstein <cocoa-dev%email@hidden>)

  • Prev by Date: Re: "Constant" strings are static or autoreleased?
  • Next by Date: Re: color row table view
  • Previous by thread: Getting information about volumes
  • Next by thread: Re: Getting information about volumes
  • Index(es):
    • Date
    • Thread