Re: identifying AppleShare mounts
Re: identifying AppleShare mounts
- Subject: Re: identifying AppleShare mounts
- From: Scott Ribe <email@hidden>
- Date: Tue, 02 Sep 2003 13:16:26 -0600
- Resent-date: Tue, 02 Sep 2003 14:13:35 -0600
- Resent-from: Scott Ribe <email@hidden>
- Resent-message-id: <BB7A48AA.32013%email@hidden>
- Resent-to: <email@hidden>
>
Thanks for the info and code. It sounds from what you're saying like if
>
my app only needs to work in OS X, I can do what I need to (identify
>
mounts). Is that correct? Is that the method your sample code uses?
>
(I'm not so great yet at deciphering Carbon networking code...any
>
suggestions about good intros to it are welcome...)
Yes, my recollection is that everything works well under OS X, all the code
that iterates over mounted volumes trying to find a match is for Classic
compatibility. I don't know any good intros on Carbon networking code, and
when I did this some of the AFP code that I used was not easily accessible
via the web site--I couldn't find a way to browse into it, but had to
stumble along guessing terms to search on. The code I use is ugly to read,
but if you search on the API calls on Apple's web site I think you'll figure
out what's going on.
In other words, I believe that under OS X my MountShare function could be
shortened to this:
>
bool MountShare( short * volref, CFStringRef ipstr, CFStringRef
>
portstr,
>
CFStringRef vol, CFStringRef usr, CFStringRef pwd )
>
{
>
bool status = false;
>
>
OSStatus err;
>
>
unsigned char ip[6];
>
AFPXVolMountInfo info;
>
if( buildip( ipstr, portstr, ip ) )
>
{
>
buildafpx( vol, usr, pwd, ip, &info );
>
>
ParamBlockRec params;
>
params.ioParam.ioBuffer = (char *) &info;
>
>
err = ::PBVolumeMount( ¶ms );
>
if( !err || err == afpAlreadyMounted )
>
{
>
status = true;
>
*volref = params.ioParam.ioVRefNum;
>
}
>
else
>
CheckErr( err, "mounting share" );
>
}
>
>
return status;
>
}
Which leaves you with a whole lot less to figure out ;-)
--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 665-7007 voice
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.