Re: Path of USB drive on Mac????
Re: Path of USB drive on Mac????
- Subject: Re: Path of USB drive on Mac????
- From: Nicko van Someren <email@hidden>
- Date: Sat, 30 Jul 2005 16:04:53 +0100
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:
This email sent to email@hidden