ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Redondo Gallardo, Raul Maria" <rmredo...@eservicios.indra.es>
Subject RE: Another options
Date Tue, 11 Aug 2009 08:00:12 GMT
Hello Francis,

Yes, you are right, but my problem (may be I'm express wrong) is that I don't know exactly
the structure folder and in spite of use de dirset option, I get the searched folders with
a Fileset and I want to split the result and extract the path to move across the folders.

I've looking for about this and I don't found anything and the tests which I've done don't
get it.

Thank you very much and sorry.

Best regards,

Raúl


-----Mensaje original-----
De: Francis GALIEGUE [mailto:fge@one2team.com] 
Enviado el: martes, 11 de agosto de 2009 9:38
Para: Ant Users List
Asunto: Re: Another options

On Tue, Aug 11, 2009 at 08:19, Redondo Gallardo, Raul
Maria<rmredondo@eservicios.indra.es> wrote:
> Thank you very much, David,
>
> This is exactly which I need, but... Is it possible to split each record of the fileset
and do something with it? I'm new with ANT and I think I want to do things quite advanced.
>
> I've got:
>
> <project name="fileset_run" basedir=".">
>
> <target name="filev2.test">
>    <condition property="file.found">
>        <resourcecount when="ge" count="1">
>            <fileset dir="D:\folder1\folder_run id="fileid">
>                <include name="**/fileV2.txt"/>
>            </fileset>
>        </resourcecount>
>    </condition>
> </target>
>
> <target name="actual.target"
>    depends="filev2.test"
>    if="file.found">
>        <echo> ${toString:fileid} </echo>
>
> </target>
>
> </project>
>
> And it shows a list like:
> c:\folder1\folder_run\folderA\FolderB\fileV2.txt;C:\folder1\folder_run\folderN\fileV2.txt
>
>
>
> Is it possible to split the output and do things for each result?

My solution does exactly that, if you refer to @{victim}/thefile in
what you want to do.

> Is it possible to obtain only the path of each of them to use it to move inside folders?
>
>
>
> Thank you very very much.
>
> Best regards,
>
> Raúl
>
>
>
> -----Mensaje original-----
> De: David Weintraub [mailto:qazwart@gmail.com]
> Enviado el: lunes, 10 de agosto de 2009 17:07
> Para: Ant Users List
> Asunto: Re: Another options
>
> On Mon, Aug 10, 2009 at 2:51 AM, Redondo Gallardo, Raul Maria <
> rmredondo@eservicios.indra.es> wrote:
>
>> I need to check a folder structure and if in a folder found a certain file,
>> do several things. Is the best way to do this to use a fileset or exist
>> another better option?
>>
>> With the fileset.... I'm locked. :S:S
>>
>
> Here's a simple way with the condition task:
>
> <target name="file.test">
>    <condition property="file.found">
>        <resourcecount when="ge" count="1">
>            <fileset dir="${dir.to.search}">
>                <include name="${file.name}"/>
>            <fileset>
>        </resourcecount>
>    </condition>
> </target>
>
> <target name="actual.target"
>    depends="file.test"
>    if="file.found">
>    <blah, blah, blah>
> </target>
>
> You execute target "actual.target". This runs the target "file.test". The
> condition will set the property "file.found" if the file ${file.name} exists
> in the directory ${dir.to.search}. If the property "file.test" is set, the
> target "actual.target" will execute. Otherwise, that target will be skipped.
>
> What's nice about this is that it doesn't require any other resources except
> for the standard Ant resources. However, you must be using Ant 1.7 or
> higher.
>
> --
> David Weintraub
> qazwart@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>



-- 

Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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


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


Mime
View raw message