• 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: mount() from Cocoa App
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mount() from Cocoa App


  • Subject: Re: mount() from Cocoa App
  • From: Dalton Hamilton <email@hidden>
  • Date: Sun, 30 Oct 2005 18:25:23 +0100

Thanks, guys.  I'm close on the AFP - I think.  I'm still trying to get the IP address.  I think I have the OTAddress returned but don't know how to interpret it.
I get through all of these success (with noErr) PBHGetVInfoSync(), then get through PBGetVolMountInfoSize() which then lets me call PBGetVolMountInfo().
I then have the data I need to tell that the FS is actually an AppleShare, I also have the correct server name (this is the server's computer name as typed in System Prefs -> sharing -- but this is gethostbyname() resolvable) and also have the correct volume/share name returned in the ParamBlockRec.  After I call PBGetVolMountInfo() I then call PBHGetVolParmsSync() trying to get the GetVolParmsInfoBuff.vMServerAdr field.  The PBHGetVolParmsSync() returns noErr but I don't know how to interpret the OTAddress structure.  
Your email below makes me think the PBGetVolMountInfo() would give the IP address of the AFP server but I don't see it anywhere -- so I then tried to use PBHGetVolParmsSync().  Apple Developer page says I need to copy the vMServerAdr before I have access to it -- but I don't understand this.

params.ioParam.ioCompletion = nil;
params.ioParam.ioVRefNum = (short)actualVolumeRefNum;
params.ioParam.ioNamePtr = nil;
params.ioParam.ioBuffer = (Ptr)&volParms;
params.ioParam.ioReqCount = sizeof(GetVolParmsInfoBuffer);
erc = PBHGetVolParmsSync(&params);
if(erc == noErr)
{
   if (volParms.vMServerAdr != 0)
           printf("Server has an IP address\n");
   strncpy(data1,(const void *)&volParms.vMServerAdr,sizeof(struct OTAddress));  // Doing a copy to see if it works
   otaddr = (struct OTAddress *)data1;
   // Just trying to interpret the OTAddressType before -- but I also don't see a way to get an IP from the fAddress UInt8.
   printf("Address Type = %u and AF_INET = %u and ATALK = %u and DNS = %u\n",otaddr->fAddressType,AF_INET,AF_ATALK_DDP,AF_DNS);

}

Thanks Guys.  I tried to post this entire function but it was too big. 
I do appreciate your continual help -- all be glad to email you all the function when I'm done.

thank you
Dalton Hamilton



On Oct 28, 2005, at 10:47 PM, Philip D. Wasson wrote:


We do something similar in a few of our apps (all Carbon). To see if the desired volume is already mounted, we start by iterating through all mounted volumes using the Carbon File Manager call PBHGetVInfoSync() in indexed mode; that gets each valid volume reference number. For each, we call PBGetVolMountInfo() to get the remote mounting info and compare the values therein with what we're looking for (you'll get an error for local volumes). 


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: mount() from Cocoa App
      • From: Dalton Hamilton <email@hidden>
References: 
 >Re: mount() from Cocoa App (From: Jim Luther <email@hidden>)
 >Re: mount() from Cocoa App (From: Quinn <email@hidden>)
 >Re: mount() from Cocoa App (From: Jim Luther <email@hidden>)
 >Re: mount() from Cocoa App (From: Dalton Hamilton <email@hidden>)
 >Re: mount() from Cocoa App (From: "Philip D. Wasson" <email@hidden>)

  • Prev by Date: Re: Crash in CFReadStreamRead
  • Next by Date: Re: mount() from Cocoa App
  • Previous by thread: Re: mount() from Cocoa App
  • Next by thread: Re: mount() from Cocoa App
  • Index(es):
    • Date
    • Thread