Skip navigation.
 
mlgetting drive/media type
FROM : Luc Vandal
DATE : Wed Apr 13 02:22:14 2005

Hi,

I've been looking for a way to get information about volumes
(removable, CD, FW, iPod, HD, etc.). So far I've been using
getFileSystemInfoForPath and statfs but unless I'm not using the
correctly, I don't really get any information about what I'm looking
for.

Here's the code I'm using:

   while (file = [enumerator nextObject])
   {
       NSString* strFile = [NSString stringWithFormat:@"%s%s", "/Volumes/",
[file cString]];
       
       [[NSWorkspace sharedWorkspace] getFileSystemInfoForPath:strFile
isRemovable:&bIsRemovable isWritable:&bIsWritable
isUnmountable:&bIsUnmountable description:&strDesc type:&strType];
       [enumerator skipDescendents];
       
       struct statfs b;
       
       statfs( [strFile cString], &b );
       
       NSDictionary* dir = [enumerator directoryAttributes];

    [self addVolume:file icon:@"VOL"];
   }

First,  strDesc and strType are always null. Is there anything helpful
in the statfs struct that could help me find the information I'm
looking for?

Thanks!

Luc

Related mailsAuthorDate
mlgetting drive/media type Luc Vandal Apr 13, 02:22
mlRe: getting drive/media type Joannou Ng Apr 13, 03:22
mlRE: getting drive/media type Luc Vandal Apr 13, 03:57
mlRe: getting drive/media type Greg Apr 13, 04:04
mlRe: getting drive/media type Luc Vandal Apr 13, 04:33
mlRe: getting drive/media type (CD/DVD only) Simon Bovet Jun 22, 14:05