ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: OS Independent file strings in resourcecollections
Date Thu, 17 Sep 2009 10:53:10 GMT
On 2009-09-17, Raja Nagendra Kumar <Nagendra.Raja@tejasoft.com> wrote:

> Hi,

> I am using ResourceCollections such as Union etc. However when ever I
> iterate, I am seeing the file names be as per the OS conventions.
> e.g if the file on windows matches to the collections and it is located in

> f:\work\nag\test.txt

> the the union iterator gives it as f:\work\nag\test.txt and not as
> f:/work/nag/test.txt.

> due to this my name matching , using restrict etc are failing. as my match
> pattern uses / instead of \ for os independency.

> In this context, is there a way to tell the ant to use always OS independent
> file path separator..

I see what you mean.  The <filename> fileselector takes care of the file
separator but the name resource selector does not.  I'd suggest adding a
handleDirSep attribute like the one for globmapper to the name selector
for the next Ant release.

Could you please file a bugzilla issue for this?

As a workaround you can use ${file.separator} instead of / all over your
patterns (or if you are using them programmatically
java.io.File.separator[Char]).

Stefan

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


Mime
View raw message