Re: How to get Volume List of Ejected Volume
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