Re: Server name
Re: Server name
- Subject: Re: Server name
- From: Nick Beadman <email@hidden>
- Date: Mon, 20 Apr 2009 11:20:40 -0700
Jan,
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.
If you only want to work with AFP then there is an older method of
getting what the server thinks its name is using PBGetVolMountInfo()
but this method returns a pascal string with no encoding specified. If
you want more details let me know and I will send you some (pseudo?)
code.
Nick
On Apr 20, 2009, at 12:29 am, Jan E. Schotsman wrote:
Hello,
Excuse me if this is a very basic question. The answer should be
easy but I haven't been able to find it.
It used to be possible to get the server name from an alias to a
file or folder on a server. The constants are still there
(asiZoneName and asiServerName) but don's serve any purpose anymore
as far as I can tell. And this was probably for AFP only.
In concreto: I have an alias to a file or folder on a XSAN server.
How do I get the server name? Same question for a file on an AFP
server. In the AFP case there is the vMServerAdr field of the
GetVolParmsInfoBuffer struct. Can I turn this into something human-
readable?
I have looked at CFURL.h but no luck.
TIA
Jan E.
--
Nick Beadman
email@hidden
(sent from my mailing list account, email@hidden)
_______________________________________________
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
References: | |
| >Server name (From: "Jan E. Schotsman" <email@hidden>) |