• 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: Jim Luther <email@hidden>
  • Date: Mon, 20 Apr 2009 14:05:31 -0700

Just use CFURLCopyHostName() if all you want is the host name.

On Apr 20, 2009, at 12:40 PM, Jan E. Schotsman wrote:


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. Schotsman@Mac- Mini._afpovertcp._tcp.local
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

_______________________________________________ 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: Server name
      • From: "Jan E. Schotsman" <email@hidden>
References: 
 >Re: Server name (From: "Jan E. Schotsman" <email@hidden>)

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