ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: Listing directories that contain a specific file
Date Mon, 17 Nov 2003 12:21:44 GMT
That reminds me to do my work for the second "task tutorial" and commit the
task ...

Ok, not official. While writing the tutorial [1] I created a task "find"
which stores
the directories as property. I haven´t committed that because - according to
<whichresource> - 
that task should be renamed to <whichfile>. But there´s some more work left
...

The <find> in the tutorial works and you should be able to get it to run :-)


Jan


[1] Tutorial:
http://cvs.apache.org/viewcvs.cgi/ant/docs/manual/tutorial-tasks-filesets-pr
operties.html
    Sources :
http://cvs.apache.org/viewcvs.cgi/ant/docs/manual/tutorial-tasks-filesets-pr
operties.zip



> -----Original Message-----
> From: Patrick Martin [mailto:patrick.martin@sungard.com]
> Sent: Monday, November 17, 2003 1:04 PM
> To: 'Ant Users List'
> Subject: Listing directories that contain a specific file
> 
> 
> Hi,
> 
> I need to get a list of directories that contain a specific file.
> For example:
> 
> ${dir}/B1/C/file.exe
> ${dir}/B2/C/notmyfile.exe
> ${dir}/B3/C/file.exe
> 
> I want to get a property containing "B1, B3" because they both contain
> file.exe.
> 
> I thought about something like:
> 
> <property name="dir.location" location="${dir}"/>
> <pathconvert property="prop" pathsep=", " dirsep="${file.separator}">
>   <path>
>     <fileset dir="${dir.location}">
>       <include name="*/C/file.exe"/>
>     </fileset>
>   </path>
>   <map
>  
> from="${dir.location}${file.separator}*${file.separator}C${fil
> e.separator}fi
> le.exe"
>     to="*"
>   />
> </pathconvert>
> 
> But it does not seem to map, the strings as I need.
> 
> Thank you,
> 
> Patrick Martin
> 
> 
> 
> 
> Confidentiality Notice: The information contained in this 
> e-mail message is
> intended only for the personal and confidential use of the 
> recipient(s)
> named above. If the reader of this message is not the 
> intended recipient or
> an agent responsible for delivering it to the intended 
> recipient, you are
> hereby notified that you have received this document in error 
> and that any
> review, dissemination, distribution, or copying of this 
> message is strictly
> prohibited. If you have received this communication in error, 
> please notify
> us immediately by e-mail, and delete the original message. 
> 
> Message confidentiel : Les informations contenues dans ce message sont
> destinees a un usage personnel et confidentiel du destinataire indique
> ci-dessus. Si le lecteur de ce message n'est pas le 
> destinataire prevu, ou
> n'est pas une personne en charge de le delivrer au 
> destinataire voulu, vous
> etes par la presente informe que vous avez recu ce document 
> par erreur, et
> que tout examen, transmission, distribution ou copie de ce message est
> totalement interdit. Si vous avez recu cette communication 
> par erreur, nous
> vous remercions de bien vouloir nous avertir immediatement 
> par e-mail et de
> detruire le message d'origine.
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message