• 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: Server name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Server name
  • Next by Date: Re: Server name
  • Previous by thread: Server name
  • Next by thread: Re: Server name
  • Index(es):
    • Date
    • Thread