Re: Mounting servers and timeouts
Re: Mounting servers and timeouts
- Subject: Re: Mounting servers and timeouts
- From: What does not kill you only makes you stronger <email@hidden>
- Date: Wed, 01 Nov 2000 18:50:23 -0600
on 11/1/00 5:36 PM, email@hidden wrote:
>
I have written a script that mounts a server in each of 35 zones (one at a
>
time) and copies a file to that server and then un-mounts the server and
>
moves to the next. Often the script fails to un-mount the server for some
>
reason. (there are no files in network trash)
>
>
How can I make sure that each server is un-mounted, before the script gives
>
up and moves on?
Here is a (similar) construct I use for a few things:
on run
set theDisk to "yourNetworkDisk"
my kCheckMountedVolume(theDisk)
end run
on kCheckMountedVolume(theDisk)
if (list disks) contains theDisk then my kUnMountVolume(theDisk)
end kCheckMountedVolume
on kUnMountVolume(theDisk)
tell application "Finder" to put away disk theDisk
my kCheckMountedVolume(theDisk)
end kUnMountVolume
-- If you don't like the possibility of getting stuck in an endless loop,
you could include a counting mechanism, say exiting after 10 tries..
>
How do I trap the error for inspection? I am using a "Try" statement.
try
tell application "Finder" to put away disk theDisk
on error errMssg number errNum
activate
display dialog (errMssg & return & errNum as string)
end try
This will give you an idea of how to catch the error (message and number),
the once you figure out what you want to catch, use an if statement to
determine what to do under those conditions.
Nate