A fileset collects only existing files. It fails only if the "dir" directory
doesnt exist.
If the files "must" exist, you could
- use a <filelist>
- check the existence with <fail> and a condition, like
<fail message="Required files missing">
<length length="3">
<fileset ...>
Jan
>-----Ursprüngliche Nachricht-----
>Von: blazingwolf7 [mailto:[email protected]]
>Gesendet: Dienstag, 23. Dezember 2008 10:28
>An: [email protected]
>Betreff: Re: AW: AW: Copying Folder
>
>
>I gave up and decide just to used the copy to copy the files
> <copy todir="${build.dir}">
> <fileset dir="${basedir}">
> <include name="host.txt"/>
> <include name="urls_re"/>
> <include name="urls"/>
> </fileset>
> </copy>
>
>But here I faced another problem again...if one of the file is
>missing..it
>won't come out error. Is there anywhere I can do to stop the
>process if a
>file fail to be copy?
>
>
>
>Jan.Materne wrote:
>>
>> You could <fileset dir="" includesfile=""/> or <filelist>.
>>
>> Jan
>>
>>>-----Ursprüngliche Nachricht-----
>>>Von: blazingwolf7 [mailto:[email protected]]
>>>Gesendet: Dienstag, 23. Dezember 2008 02:37
>>>An: [email protected]
>>>Betreff: RE: AW: Copying Folder
>>>
>>>
>>>Yes..thank you this is a good solution. But now I have a
>>>different thought.
>>>Can I for example prepare a list, then in the list I will
>>>specify what file
>>>I want to transfer from the root directory to the new folder.
>>>
>>>Then it will refer to the file to determine which file to copy
>>>and which
>>>file not to transfer.
>>>Can that be done?
>>>
>>>Rebhan, Gilbert wrote:
>>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: blazingwolf7 [mailto:[email protected]]
>>>> Sent: Monday, December 22, 2008 10:12 AM
>>>> To: [email protected]
>>>> Subject: Re: AW: Copying Folder
>>>>
>>>> /*
>>>> Not really...I just want to copy the files from the root directory
>>>> But the root directory will have folders as well. Now the
>>>problem I faced
>>>> is
>>>> how to filter out all the folders so that it only copy the
>>>files from the
>>>> root directory
>>>> */
>>>>
>>>> after reading again, i believe you mean =
>>>>
>>>> a given folderstructure like that =
>>>>
>>>> c:\test>tree /F /A
>>>>
>>>> C:.
>>>> | foo.txt
>>>> | foobar.txt
>>>> | foobaz.txt
>>>> |
>>>> +---sub
>>>> | \---subsub
>>>> | sub.txt
>>>> |
>>>> \---sub1
>>>> \---subsub
>>>> sub1.txt
>>>> ...
>>>>
>>>> and you want to copy only the files on rootlevel
>>>> foo.txt
>>>> foobar.txt
>>>> foobaz.txt
>>>>
>>>> right ??
>>>>
>>>> to achieve that, just use the *.* include pattern
>>>> to catch only the files on roolevel =
>>>>
>>>> <project default="copy">
>>>> <target name="copy">
>>>> <copy todir="C:/flatten">
>>>> <fileset dir="C:/test" includes="*.*" />
>>>> </copy>
>>>> </target>
>>>> </project>
>>>>
>>>>
>>>> Regards, Gilbert
>>>>
>>>>
>---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [email protected]
>>>> For additional commands, e-mail: [email protected]
>>>>
>>>>
>>>>
>>>
>>>--
>>>View this message in context:
>>>http://www.nabble.com/Copying-Folder-tp21124245p21138187.html
>>>Sent from the Ant - Users mailing list archive at Nabble.com.
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: [email protected]
>>>For additional commands, e-mail: [email protected]
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>>
>
>--
>View this message in context:
>http://www.nabble.com/Copying-Folder-tp21124245p21141650.html
>Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [email protected]
>For additional commands, e-mail: [email protected]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]