• 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: How to get Volume List of Ejected Volume
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get Volume List of Ejected Volume


  • Subject: Re: How to get Volume List of Ejected Volume
  • From: Quinn <email@hidden>
  • Date: Thu, 9 Oct 2008 10:00:03 +0100

At 10:27 +0530 25/9/08, vishal chauhan wrote:
I want to get the volume list on Mac.

I am using the function

result = FSGetVolumeInfo(kFSInvalidVolumeRefNum,
                                 volumeIndex,
                                 &actualVolume,
                                 kFSVolInfoGettableInfo,
                                 &volumeInfo,
                                 &volumeName,
                                 NULL);

This function gives me all the mounted volume Information.I have a firwire which shows in the list only when it is mounted and when I eject
it then it does not return by the FSGetVolumeInfo but is shown in the lsit if I do diskutil list.


So how can i get it on the volume list through my program?

File Manager updates its volume list by registering a number of Disk Arbitration callbacks. These are scheduled on the main thread's runloop. Thus, for File Manager to maintain an accurate volume list, you must be running the main thread's runloop. That happens automatically for standard application code (Cocoa's NSRunLoop and Carbon's EventLoopRef are both based on CFRunLoop), but other types of programs are typically based on other main event loop technology (select, or kqueues, or whatever) and these don't automatically run the CFRunLoop. There are two standard workarounds:


o Created a separate thread whose sole purpose is to run a runloop in which you registered your runloop sources. This doesn't solve the volume list problem, because File Manager always registers its DiskArb runloop sources on the main thread.

o Move you real main event loop to a separate thread and leave the main thread running the runloop just to handle File Manager sources.

S+E
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: A hand with FSEventStreamCreateRelativeToDevice
  • Next by Date: Re: Can I flush the cache for an AFP volume?
  • Previous by thread: A hand with FSEventStreamCreateRelativeToDevice
  • Next by thread: Re: Can I flush the cache for an AFP volume?
  • Index(es):
    • Date
    • Thread