You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by cr...@comcast.net on 2004/10/22 19:06:24 UTC

RE: File name to a string

Sorry if this seems very basic, but I am brand new to ANT. What I am trying to do is have a task read a directory and create an output text file with all the names that are in the directory. Is this possible.
I know how to use the concat to display the contents of the file but not sure how to just read the file name. Any suggestions?
Thanks in advance for all the help.
Craig

RE: File name to a string

Posted by Matt Benson <gu...@yahoo.com>.
--- craig_e_davis@comcast.net wrote:

> Sorry if this seems very basic, but I am brand new
> to ANT. What I am trying to do is have a task read a
> directory and create an output text file with all
> the names that are in the directory. Is this
> possible.

No problem, Craig.  All you gotta do is use a
<fileset> to select your files, wrap it in a <path>,
pass that to a <pathconvert>, and <echo> that to a
file.  :)  If you want one filename per line, you can
specify "${line.separator}" as <pathconvert>'s pathsep
attribute.

HTH,
Matt


		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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