• 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
getting drive/media type
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

getting drive/media type


  • Subject: getting drive/media type
  • From: Luc Vandal <email@hidden>
  • Date: Tue, 12 Apr 2005 20:22:14 -0400

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
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: getting drive/media type
      • From: Joannou Ng <email@hidden>
  • Prev by Date: dragPromisedFilesOfTypes for 10.1
  • Next by Date: Re: NSSpellChecker crashes after 64k words
  • Previous by thread: Re: dragPromisedFilesOfTypes for 10.1
  • Next by thread: Re: getting drive/media type
  • Index(es):
    • Date
    • Thread