Re: How to identify the server from which a volume was mounted?
Re: How to identify the server from which a volume was mounted?
- Subject: Re: How to identify the server from which a volume was mounted?
- From: Jerry Krinock <email@hidden>
- Date: Wed, 1 Jul 2009 05:16:27 -0700
On 2009 Jul 01, at 01:39, Quinn wrote:
At 22:19 -0700 30/6/09, Jerry Krinock wrote:
Possibly, would a file Alias (as in Alias Manager) know what server
it is on?
Yes. The solution here is simple: don't store a full path, store an
alias. The Alias Manager will take care of recording information
about the server, and remounting the server if necessary. It will
do a much better job than you can (-:
Ah, thanks, Quinn. I see that storing an alias record will make life
easier for me in several ways.
Although I can access the file now, my application allows users to
import/export similarly-named files on different volumes and servers,
so I would like to include the server name in the display name.
Volume names are often ambiguous and cause confusion if the server
name is not given.
The documentation of the depracated function GetAliasInfo() says it
can return a server name, but its replacement, FSCopyAliasInfo(), does
not seem to have this capability. (Server name is not returned in any
of the by-reference parameters, and the FSAliasInfo struct does not
include a server name field either.)
How can I get the server name, to display to the user?
Jerry
P.S. Again, if Alias Manager can't, maybe statfs(2) can do this. If
I call statfs() upon a file on an afp volume, the mntfromname field of
the returned struct is a C string, for example:
afp_2lZ2Za000bB10000oM0000VU-1.2e00002e
I'd bet that those characters would identify the server if someone
could explain how to decode it.
_______________________________________________
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