Double mounted afp volumes
Double mounted afp volumes
- Subject: Double mounted afp volumes
- From: Jim Skibbie <email@hidden>
- Date: Thu, 13 Mar 2008 15:32:53 -0500
- Thread-topic: Double mounted afp volumes
Title: Double mounted afp volumes
I have an existing script which goes through a headstand to mount a volume using afp. This is needed because sometimes the Finder errors while attempting to mount the volume and has to repeat itself until it comes to grips that it is actually mounted.
This script seems to work in Tiger, but in Leopard, it is being blamed for causing ‘ghost volumes’ to be mounted.
For example, users are getting multiple volumes mounted of the same volume. So there is a volume called “Assets” and another volume called “Assets-1”. If you go to the Finder and do “Go To Folder” and view “/Volumes”, one of the volumes is represented as an empty folder while the other volume is actually the real volume.
Has anyone seen this and is there a work-around to it?
Thanks.
Jim
my persistentMount({nameofvolume}, afpURL, max_tries)
on persistentMount(vols_to_mount, Server_Path, max_tries)
{vols_to_mount, Server_Path, max_tries}
set mounted_vols to list disks
delay 1
set attempts to 0
repeat until (check_list_containment(vols_to_mount, mounted_vols))
repeat with vol in vols_to_mount
if mounted_vols does not contain vol then
--set encoded_vol to encode_text(vol)
set mount_url to (Server_Path & vol) as string
try
mount volume mount_url
on error errMsg number errNum
if errNum is -128 then error number -128
-- else fail silently
end try
end if
delay 1
end repeat
delay 4
tell application "Finder" to set mounted_vols to list disks
if not check_list_containment(vols_to_mount, mounted_vols) then
-- try once more, Finder is slow to register
if check_list_containment(vols_to_mount, list disks) then return
else
return
end if
set attempts to attempts + 1
if (attempts > max_tries) then ¬
error ("ERROR: file server may be down. #persistentMount tried " & ¬
attempts & ¬
" times to mount the required servers" as string)
end repeat
end persistentMount
-- check if each item in aList is in aContainer
-- return false if not
on check_list_containment(aList, aContainer)
repeat with i in aList
if i is not in aContainer then return false
end repeat
return true
end check_list_containment
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden