If you need to access a remote Macintosh file server from your application,
you can check if the server is mounted using the Volume function. If it's
not, there is a way to mount the volume from code using the REALbasic
ShowURL command. The syntax is:
ShowURL "afp://username:password at ServerIPAddressOrURL/VolumeName"
For example, to mount a volume called "Macintosh HD" on a server named
"server.mycompany.com" with a user name of "fred" and the password
"opensesame", you would use the following code:
ShowURL "afp://fred:opensesame at server dot mycompany dot com/Macintosh HD"
AFP stands for Apple Filing Protocol. You've probably noticed this prefix
when mounting a file server on Mac OS X using the Connect To Server menu
item on the Go menu.
You'll have to use a timer to scan the mounted volumes (using the Volume
function) until the volumeName appears before you attempt to access the
file. Once the server is mounted you can use the standard file commands like
GetFolderItem to access files.
--
Geoff Perlman
President and CEO
REAL Software, Inc.
512-328-7325 x711 (voice)
512-328-7372 (fax)
- - - - - - - - - -
Got a useful tip to share? Send it to us at:
REALbasic-tips at lists dot realsoftware dot com dot
To unsubscribe from the Tips list, send an email to
<mailto:realbasic-tips-off at lists dot realsoftware dot com>
|