I folks,
I am developing a small app which should be able to unmount volumes.
Currently, I am using the following code to determine whether a volume is unmountable or not:
BOOL isRemovable, isWritable, isUnmountable;
NSString *description, *type;
BOOL succ = [ws getFileSystemInfoForPath:[itemInfo objectForKey:@"path"]
isRemovable:&isRemovable
isWritable:&isWritable
isUnmountable:&isUnmountable
description:&description
type:&type];
The problem is that only physically removable volumes like a CD or DVD get isUnmountable=YES flag. USB devices don't, although these are unmountable, too.
Do you guys have a solution for that?
---- Edit
I tried it out with another USB stick which is FAT formatted. I got 2 USB hard disks connected to my mac which are unmountable via the Finder or Disk Utility - these are HFS formatted. I created an output which uses the code from above:
/, hfs, unmountable: NO, removable: NO
/Volumes/Elephant, hfs, unmountable: NO, removable: NO
/Volumes/Time Machine, hfs, unmountable: NO, removable: NO
/Volumes/USBSTICK, msdos, unmountable: YES, removable: YES
It looks like the method only returns YES if the device is FAT or MSDOS formatted. This is weird because the other 2 (Elephant, Time Machine) are volumes that are connected via USB and have to be removable and unmountable. Is there another way to get that information or have I done something wrong in my code?
--
Regards
Marco