Hi,

/*
I'd recommend to use <pathconvert> before the <echo>, rather than a
filter chain with <loadfile>. In fact, since you are not echo'ing out
a properties file it seems, you could even do the direct <echo> and
use <pathconvert> after the <loadfile> as well, because <loadfile> is
not affected with baskslash-based escape sequences. --DD
*/

yup, my example should have been =

...
<echo
file="C:/cc_workdir/temp.order">orderfile=${order.candidate}</echo>
...

means echoing a propertyfile, that's where i stumbled upon that.
in a non property file this problem does not appear.

Could you give a short example where and how to apply the pathconvert
to that  ?=

    <!-- Import AntContrib -->
    <taskdef resource="net/sf/antcontrib/antlib.xml" />

    <target name="depends">
        <path id="mypath">
            <fileset dir="Y:/bla">
                <include name="*.jar" />
            </fileset>
        </path>
        <timestampselector property="targetfile" pathref="mypath"
count="1" age="eldest"/>
        <echo
file="Y:/bla/foobar.properties">filepath=${targetfile}</echo>
    </target>


    <target name="main" depends="depends">
        <propertyfile file="Y:/bla/foobar.properties" />
        <echo>Targetfile === ${filepath}</echo>
    </target>


Regards, Gilbert 

-----Original Message-----
From: Dominique Devienne [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 26, 2006 2:42 PM
To: Ant Users List
Subject: Re: Location attribute in property not resolving correctly

> that's the reason i _always_ use the unix style ' / '
> although i'm running on windows.

Yes, that what I recommend as well.

> if you use a path on a windows machine, f.e. :
> the path in the file you echoed to looks like :
>       C:\the\path\to\something
> the windows path separator is used as you are running on windows
>
> so if you try to load that file as property later, you have to go like
> that =
>
> <loadfile property="ordertxtfile" srcfile="C:/cc_workdir/temp.order">
>        <filterchain> <replacestring from="\" to="/" /> </filterchain>
> </loadfile>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to