This idea is also very good but i have problem.

java.lang.NoClassDefFoundError:  org/apache/bsf/BSFException" error

which library do i need for running ruby?

Thx


--------- Original Message --------
From: Ant Users List <user@ant.apache.org>
To: Ant Users List <user@ant.apache.org>
Subject: RE: Open and read file with ant and then copy
Date: 10/09/07 14:44

>  
> 
> Hi,
> 
> -----Original Message-----
> From: Rebhan, Gilbert [mailto:[EMAIL PROTECTED] 
> Sent: Monday, September 10, 2007 12:49 PM
> To: Ant Users List
> Subject: RE: Open and read file with ant and then copy
> 
> Oops, use =
> 
> &lt;script language=&quot;ruby&quot;&gt;
> &lt;![CDATA[
>      
> require 'fileutils'
> File.open('C:WKSEclipse322WEB_neucopytest.txt', &quot;r&quot;).each do
|line|
>   arr=line.split(' ')
>   FileUtils.mkdir_p(File.dirname(arr[1]),:verbose=&gt;true)
>   FileUtils.cp(arr[0],arr[1],:verbose=&gt;true)
> end
> ]]&gt;
> &lt;/script&gt;
> 
> instead of =
>       
> require 'fileutils'
>      
> File.open('C:WKSEclipse322testcopytest.txt', &quot;r&quot;).each do |line|
>   FileUtils.mkdir_p(File.dirname(line.split(' ')[1]),:verbose=&gt;true)
>   FileUtils.cp(line.split(' ')[0],line.split(' ')[1],:verbose=&gt;true)
> end
> 
> so the method line.split() is only called once
> If you need another separator, i.e.  # just use line.split('#')
> 
> Regards, Gilbert
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

________________________________________________
Message sent using UebiMiau 2.7.10



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to