• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [Solved] Re: Checking to see if a server volume is already mounted?
[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?


  • Subject: Re: [Solved] Re: Checking to see if a server volume is already mounted?
  • From: Adhamh Findlay <email@hidden>
  • Date: Tue, 30 Oct 2007 22:52:18 -0500

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:
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>)

  • Prev by Date: setRelationshipKeyPathsForPrefetching:
  • Next by Date: Re: Determine if App is launched thru alias?
  • Previous by thread: Re: [Solved] Re: Checking to see if a server volume is already mounted?
  • Next by thread: Problem with NSImage in JNI
  • Index(es):
    • Date
    • Thread