ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Pepersack" <RPepers...@mdinsurance.state.md.us>
Subject Re: AW: Check to See If Directory Exists
Date Wed, 11 Oct 2006 12:37:25 GMT
Thanks everybody!  Your responsiveness is part of why, as a new person to Ant, I love it already.
 In comparision to other forums I've posted questions to in the past, this forum is by far
the best I've seen.

Bob
>>> Jan.Materne@rzf.fin-nrw.de 10/11/2006 8:27 AM >>>
Ok, not everyone does have a look into the source ;-)

   oata.taskdefs.MKdir.java:036: public class Mkdir extends Task {
   oata.taskdefs.MKdir.java:   :    ...
   oata.taskdefs.MKdir.java:048:    public void execute() throws BuildException {
   oata.taskdefs.MKdir.java:   :        ...
   oata.taskdefs.MKdir.java:059:        if (!dir.exists()) {
   oata.taskdefs.MKdir.java:060:            boolean result = mkdirs(dir);


I'll put a not into the manual (revision 462786).

Jan 

>-----Urspr√ľngliche Nachricht-----
>Von: Robert Pepersack [mailto:RPepersack@mdinsurance.state.md.us] 
>Gesendet: Mittwoch, 11. Oktober 2006 14:07
>An: user@ant.apache.org 
>Betreff: Re: Check to See If Directory Exists
>
>OK.  I looked in the online documentation and read from the 
>book "Java Development With Ant", but neither documented this 
>behavior of <mkdir>.
>
>Thanks for your help,
>
>Bob
>
>Robert Pepersack
>Senior Lead Developer
>Maryland Insurance Administration
>410-468-2054
>
>>>> ddevienne@gmail.com 10/10/2006 4:29 PM >>>
>> I need to check to see if a directory exists, and if not, then
>create
>> the directory.  But, if the directory already exists, then leave it 
>> alone, because it may already contain some important files.  I have
>more
>> than a dozen directories to check for, and I would like to find a way
>to
>> do this that's less verbose than a bunch of <property> and
><available>
>> tasks.  Does anyone know how?
>>
>> Here's the equivalent command from a batch file:
>>
>> if not exist c:\myapp mkdir c:\myapp
>
>Well, since <mkdir> is a no-op for an existing directory, you 
>don't even need to use <available>. And to process several 
>dirs, either manually write all the <mkdir>s, or select the 
>dirs in a <fileset> or <path>, and loop over it using 
>Ant-Contrib's <for> task. --DD
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For 
>additional commands, e-mail: user-help@ant.apache.org 
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org 
>For additional commands, e-mail: user-help@ant.apache.org 
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org 
For additional commands, e-mail: user-help@ant.apache.org 


Robert Pepersack
Senior Lead Developer
Maryland Insurance Administration
410-468-2054


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message