Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Path of USB drive on Mac????



On 30 Jul 2005, at 13:36, darpan kamboj wrote:

I want to raw read the file from the USB drive. But on Mac i don't know the path from which i read the file in USB drive. Plz if any body know the path of USB drive on mac then reply me.

This is not really a Cocoa question, but I'll point you in the right direction.


If the device is mounted as a drive and you know the path under which the device is mounted you can use the statfs() system call to get the filing system path of the underlying device, which you can then open as a simple file.

If you don't know the path under which your USB drive is mounted but the user us capable of picking it from a list you can get the list of mounted removable media from:
[[NSWorkspace sharedWorkspace] mountedRemovableMedia]
To make this list look pretty you might want to strip the "/Volumes/" of the front of each item before you display them.


If you don't know where the device is mounted, or if it has some unsupported file system format so it is never going to be mounted, then you are going to need to dig deeper into the world of IOKit, which is definitely off topic for this list. I'd start by reading the documentation at on IOKit and the USB system at:
http://developer.apple.com/documentation/DeviceDrivers/ Conceptual/IOKitFundamentals/
http://developer.apple.com/documentation/DeviceDrivers/ Conceptual/USBBook/
and then move on to the Apple USB list for more help.


    Cheers,
        Nicko

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Path of USB drive on Mac???? (From: "darpan kamboj" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.