ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <>
Subject RE: ReplaceRegExp with windows filenames
Date Fri, 26 Aug 2005 07:03:52 GMT

-----Original Message-----
From: Neil Benn [] 
Sent: Thursday, August 25, 2005 9:55 PM
To: Ant Users List
Subject: Re: ReplaceRegExp with windows filenames


    So, it seems if I use ReplaceRegEx on the file or load the file
into a property and if I use one or two backslashes in the, I get out
something like this (either from an echo or in the file:

     [echo] 1 = ,"DropPaqEtc",,"C:Documents and SettingsNeil BennMy
Documentssvn_timtrunkDropPaq\installer\CE"   ; The etc directory which
contains all image and the jar file



Sorry, didn't get your problem right, but maybe a point in
the right direction :

had a similar problem here with pathseparator ' \ ' on Windows =

in one antscript i grab one filename/path out of a directory with
antcontrib/timestampselector and echo that property to a file :

<path id="path.order">
            <fileset dir="${...}">
                <include name="*.txt" />
        <timestampselector property="order.candidat"


in another script i load the property ${order.candidat} again, but as
the path
in that property on windows is something like :


the property gets C:deployserverpathtomytxtfilefoobar.txt when loaded
cause the ' \ ' is not masked (has to be ' \\ ' in java)

so i have to load it like that :

<loadfile property="auftragtxt"
<replacestring from="\" to="/" />

and it get's loaded with ' / ' as pathseparator -> OK

btw, i always use ' / ' instead of ' \ ' even on windows (ant handles
that for you), 
because i noticed several strange things when using  ' \ ' on windows.

i even created a patch for the ant faq.xml and the ant manual /
some time ago, but somehow no one noticed and it didn't get in.

[ <faq id="win-backslashes"> ]

Regards, Gilbert

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message