Re: Server name
Re: Server name
- Subject: Re: Server name
- From: "Jan E. Schotsman" <email@hidden>
- Date: Mon, 20 Apr 2009 21:40:39 +0200
On Apr 20, 2009, at 9:06 PM, Nick Beadman wrote:
I know of a couple of different ways to get a server name. If you want
what the Finder shows in the Get Info window after Server: label then
take the FSVolumeRefNum and call (Mac OS X 10.3 and later):
extern OSStatus FSCopyURLForVolume(FSVolumeRefNum vRefNum, CFURLRef
*url);
you can then get an CFStringRef from the CFURLRef.
That's a good start!
error = FSCopyURLForVolume( vRefNum, &url );
if ( error ) goto END;
if ( url )
{
netLocationStr = CFURLCopyNetLocation( url );
userName = CFURLCopyUserName( url );
hostName = CFURLCopyHostName( url );
}
netLocationStr = Jan E. email@hidden
userName = Jan E. Schotsman
hostName = Mac-Mini._afpovertcp._tcp.local
Finder Get Info says: Server: afp://Mac-Mini._afpovertcp._tcp.local
Looks like Mac-Mini is the computer name.
So I take the part before the first dot in netLocationStr?
No need to replace sequences I suppose?
Would that work from an XSAN client too?
Jan E.
_______________________________________________
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