Mounter.h header file
#include <sys/param.h> #include <sys/ucred.h> #include <sys/mount.h> @interface Mounter : NSObject { struct statfs *buf; int i, count; @private } -(void) getMountList; @end
Implementation of the Mounter.m file:
#import "Mounter.h" @implementation Mounter -(void) getMountList { NSFileManager *fm = [NSFileManager defaultManager]; count = getmntinfo(&buf, 0); for (i=0; i<count; i++) { NSString *path = [NSString stringWithUTF8String:buf[i].f_mntonname]; NSLog(@"Drivers: %@", path); }
source share