ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harold Putman <hput...@lexmark.com>
Subject Re: conditional make-directory
Date Tue, 24 Apr 2012 14:59:41 GMT
You just do...

        <tempfile property="my-temp" suffix=""/>
        <mkdir dir="${my-temp}"/>

The creates the directory in basedir, and by using tempfile you  guarantees
that the directory does not already exist. But if the directory did already
exists, mkdir will do nothing, there is no need to check first.

(BTW thanks for the XSLT FAQ. I spend a lot of time out there)

On Tue, Apr 24, 2012 at 10:44 AM, Dave Pawson <dave.pawson@gmail.com> wrote:

> I need a temporary directory.
>
> What's the 'ant speak' for
>
> property name='my-temp'  if directory exists (my-temp) then my-temp
> else mkdir 'my-temp'
>
> I hope that's clear?
> In bash it might be
>
> #check/create fo directory for output, per font
> if [[ ! -d ${here}/fo ]]
>    then
>    mkdir ${here}/fo
>
> fi
>
>
>
> TIA
>
> --
> Dave Pawson
> XSLT XSL-FO FAQ.
> Docbook FAQ.
> http://www.dpawson.co.uk
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


-- 
Harold PUTMAN
Web Technology Specialist
*Lexmark International, Inc. <http://www.lexmark.com>*
740 W New Circle Rd.
Lexington, KY 40550
+1(859) 232-2839
hputman@lexmark.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message