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: [Solved] Re: Checking to see if a server volume is already mounted?



Excellent point!  This could should fix that problem:

// check to see if the iDisk is already mounted.
NSString *mountediDisk = nil;
struct statfs *buf;
int i, count;
const char *idiskName = [[NSString stringWithFormat: @"http:// idisk.mac.com/%@/", [dictionary valueForKey: @"username"]] UTF8String];
count = getmntinfo(&buf, 0);
for(i=0; i < count; i++) {
if(strcmp(buf[i].f_mntfromname, idiskName) == 0)
mountediDisk = [NSString stringWithUTF8String: buf[i].f_mntonname];
}



Instead of comparing f_mnttoname this compares f_mntfromname. This should be a much more robust implementation.


Thanks for catching that!

Adhamh

On Oct 30, 2007, at 9:49 PM, John Stiles wrote:

Be careful. Mountpoints in /Volumes are not guaranteed to have the same name as what you see in the Finder. For instance, rename your hard drive to "Adhamh" and then mount your iDisk and see what its mountpoint name is. (I'd guess Adhamh-1, but there's no guarantee of that either.)

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Checking to see if a server volume is already mounted? (From: Adhamh Findlay <email@hidden>)
 >[Solved] Re: Checking to see if a server volume is already mounted? (From: Adhamh Findlay <email@hidden>)
 >Re: [Solved] Re: Checking to see if a server volume is already mounted? (From: John Stiles <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.