You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Lee, Michael.M" <Mi...@westgroup.com> on 2003/03/10 20:11:49 UTC

Error proof Ant Task

I have a target in my script that mounts the network drive.  It can be
unmounted at the end of the script.

However, once the build fails, it never gets to unmount the drive.  So if i
try to run it next time, it gives an error because the network drive is
already in the system and cannot mount it twice.

so here is my question.

is it possible to write an ant task so that it checks whether there is a
mounted drive or not, and if there is, unmount it first, otherwise, just go
to next task?

thanks.

Re: Error proof Ant Task

Posted by Adam M <ad...@sitraka.com>.
Michael,

I've done the exact same thing in the past. All you need to do is
unmount the network drive first. If
the drive is not mounted to begin with, attempting to unmount it does
not result in an error.

Lee, Michael.M wrote:

PS. I've been having trouble getting any email to the newsgroup. Please
forward this message to the newsgroup if you find it useful. Thank you.

>I have a target in my script that mounts the network drive.  It can be
>unmounted at the end of the script.
>
>However, once the build fails, it never gets to unmount the drive.  So if i
>try to run it next time, it gives an error because the network drive is
>already in the system and cannot mount it twice.
>
>so here is my question.
>
>is it possible to write an ant task so that it checks whether there is a
>mounted drive or not, and if there is, unmount it first, otherwise, just go
>to next task?
>
>thanks.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>  
>



Re: Error proof Ant Task

Posted by Adam M <ad...@sitraka.com>.
Michael,

I've done the exact same thing in the past. All you need to do is 
unmount the network drive first. If
the drive is not mounted to begin with, attempting to unmount it does 
not result in an error.

Lee, Michael.M wrote:

>I have a target in my script that mounts the network drive.  It can be
>unmounted at the end of the script.
>
>However, once the build fails, it never gets to unmount the drive.  So if i
>try to run it next time, it gives an error because the network drive is
>already in the system and cannot mount it twice.
>
>so here is my question.
>
>is it possible to write an ant task so that it checks whether there is a
>mounted drive or not, and if there is, unmount it first, otherwise, just go
>to next task?
>
>thanks.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>  
>