How to check a file exist or not, before I copy ?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rami_R
Posted On:   Friday, September 5, 2003 02:08 AM

Hi I am building two jars in my project namely NServer & NClient. to respective folders. --> overwrite="true" /> overwrite="true"/> But I would't always built both server & client. So, if I run ant like the following ant -l Result.log init,nserver,clean it definitely gives error that it couldn't find jarsNClient.jar & build fails. I can set failonerror="false" so that build wouldn't fail. But is there any way that I can check the file exis   More>>

Hi

I am building two jars in my project namely NServer & NClient.


























overwrite="true" />



overwrite="true"/>











But I would't always built both server & client. So, if I run ant like the following

ant -l Result.log init,nserver,clean

it definitely gives error that it couldn't find jarsNClient.jar & build fails. I can set
failonerror="false" so that build wouldn't fail. But is there any way that I can check the
file existance before I copy it over?



Thanks

   <<Less

Re: How to check a file exist or not, before I copy ?

Posted By:   Clifton_Craig  
Posted On:   Friday, September 5, 2003 08:19 AM

You can use the available task to check for the availability of files. However, I might suggest that you consider using a deploy target in lieu of the copies in your clean target. You can perform cleanup after the deploy target to clean your build directory. You can also make the deploy target conditional on a property set via available in your init target. For example something like this might be in order:



...


...



overwrite="true" />







overwrite="true"/>



Kind Regards,
Cliff
About | Sitemap | Contact