Re: Volume Tracking in Cocoa without Carbon?
Re: Volume Tracking in Cocoa without Carbon?
- Subject: Re: Volume Tracking in Cocoa without Carbon?
- From: Trevor McCulloch <email@hidden>
- Date: Mon, 14 May 2001 20:15:25 -0400
On Monday, May 14, 2001, at 02:48 PM, G. 'Andrew' Tapolow wrote:
I'm looking for a method to get a list of mounted volumes (and
theoretically their icons). At the same time I am looking for something
like system even messages for disk mount and disk eject. I know where
these were in the Mac OS APIs and thus know where I could look for them
in Carbon. However, my goal is to work these into a Cocoa (obj-c) only
app through Project Builder and have had no luck finding NSObjects or
the appropriate framework through header files or documentation.
There are a few UNIXEN solutions to this problem. The one closest to
what you are looking for is getfsstat() (man 2 getfsstat) which returns
an array of statfs structures about all of the mounted file systems.
A slightly less elegant solution would be to read the /dev filesystem
looking for disk devices, then use the method readlabelfs() (man 3
readlabelfs) to get information on the partition.
Trevor McCulloch