You should always use the slash '/' and Ant will convert it on Windows.
There is only one cases (I am aware of) where you will need the 'correct' one: 
if you create files for native access:
<echo file="${build.dir}/my.bat">
  cd c:\apache-ant\1.7.1\bin
  call ant.bat
</echo>
<exec executable="cmd.exe"><arg value="${build.dir}/my.bat"/></exec>

You could use ${file.separator} but i think if you create batch/shell scripts 
that way you are platform dependent anyway ...


Jan


> -----Ursprüngliche Nachricht-----
> Von: Gilbert Rebhan [mailto:a...@schillbaer.de] 
> Gesendet: Freitag, 27. November 2009 19:35
> An: Ant Users List
> Betreff: Re: Slash issue in ANT script
> 
> jhudson schrieb:
> > hi,
> > 
> > My script should work both in Unix and winddows, I don't 
> know how to handle
> > slash (\) in ANT script in this case. Could some one please help me.
> 
> The use of the unix slash '/' is strongly recommended, 
> whether you're on
> windows or not., ant(java) will handle it correctly.'
> i always use it that way without any problems, not only with ant but
> with java in general.Much simpler to write your/path/to/whatever than
> your\\path\\to\\whatever ..
> 
> 
> Regards, Gilbert
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
> For additional commands, e-mail: user-h...@ant.apache.org
> 
> 

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

Reply via email to