ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan \"Rambius\" Ivanov" <rambiusparkisan...@yahoo.com>
Subject Re: Create a file that contains files in directory
Date Mon, 17 Apr 2006 20:58:06 GMT
Hello,

Here is a sample script that does this:

<project>
    <fileset dir="${basedir}" id="all.files.fs">
        <include name="**/*"/>
    </fileset>
    <pathconvert property="all.files"
pathsep="${line.separator}"
        refid="all.files.fs"/>
    <echo file="allfiles.txt">${all.files}</echo>
</project>

Note that allfiles.txt will contain the absolute
locations of the files. If you need relative ones you
may want to use mappers:

    <pathconvert property="all.files"
pathsep="${line.separator}"
        refid="all.files.fs">
        <globmapper
from="${basedir}${file.separator}*" to="*"/>
    </pathconvert>

Regards
Ivan

--- "Guttula, Mohan" <MGuttula@tiaa-cref.org> wrote:

> Hello All,
> 
>  
> 
> I need to generate a file that contains list of
> files from a directory
> (that will contain subdirectories). 
> 
> Something similar to copying the output of "ls" or
> "dir" to a file.
> 
>  
> 
> For example: 
> 
> Folder "temp" contains folders "temp1", "temp2", and
> a file "temp.tab"
> 
> Folder "temp1" contains folder temp3 and file
> "temp1.ind"
> 
> Folder "temp2" contains folder temp4 and file
> "temp2.trg"
> 
> Folder "temp3" contains file "temp3.seq"
> 
> Folder "temp4" contains file "temp4.fn"
> 
>  
> 
> I need to generate a file which contains the
> following contents:
> 
> ----
> 
> temp/temp.tab
> 
> temp1/temp1.ind
> 
> temp2/temp2.trg
> 
> temp3/temp3.seq
> 
> temp4/temp4.fn
> 
> ----
> 
>  
> 
> Note: Contents of "temp" folder changes during each
> checkout from Source
> code control.
> 
>  
> 
> Thanks,
> 
> Mohan
> 
>  
> 
>  
> 
>  
> 
>  
> 
> 
> 
>
**************************************************************
> This message, including any attachments, contains
> confidential information intended for a specific
> individual and purpose, and is protected by law.  If
> you are not the intended recipient, please contact
> sender immediately by reply e-mail and destroy all
> copies.  You are hereby notified that any
> disclosure, copying, or distribution of this
> message, or the taking of any action based on it, is
> strictly prohibited.
> TIAA-CREF
>
**************************************************************
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Mime
View raw message