Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mkristain

macrumors regular
Original poster
Aug 18, 2011
115
0
hello

i want to get connected removable device list,please anybody help me to do this.

thanks.
 
i have tried to get how many removable drives are connected to mac.

coz when i use this

Code:
struct statfs *buf = NULL;
	unsigned ii, count = 0;
	
	count = getmntinfo(&buf, 0);
	for (ii=0; ii<count; ii++)
	{
		char *volName = buf[ii].f_mntonname;
		printf("Volume: %s\n", volName);
	}

its give all mounted drives not only valid strorage drives.
 
can u please more specific about NSWorkspace because there is so many methods and functions in this class so i don't understand which one is use for this.

if possible can u please provide me any sample app.

thanks and appreciate ur all suggestion and help.
 
i am get the list by this
Code:
NSArray *removableDrivesPaths = [[NSWorkspace sharedWorkspace] mountedRemovableMedia];

but its also display mounted drive of .dmg

i just want only removable drives like i connected a drive to mac.
 
Last edited:
i am get the list by this
Code:
NSArray *removableDrivesPaths = [[NSWorkspace sharedWorkspace] mountedRemovableMedia];

but its also display mounted drive of .dmg

i just want only removable drives like i connected a drive to mac.

Sounds like you need to start investigating the attributes of the mountedRemovableMedia... start going through the documentation (which someone already provided) and see how you can tell the difference between a mounted .dmg and a mounted external drive.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.