ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject Re: ftp task fails when file has ' (apostrophe symbol)
Date Mon, 22 May 2006 15:45:53 GMT
David wrote:
> (Read this message, it is more readeable)
>   I have to get a file from the server, 
> but the name has to be encloses by '   symbol, for example: 
> 'foo.txt', but Ant process the file name an eliminates the   
> delimitors. I have tested the ftp action with a file without ' 
> on its name and   it works.    It is a problem with the ftp task and not 
> with the fileSet definition, I guess   because I have tried to use the 
> '-symbol on the name for making a copy of the   file and it works (see below)    
>   I am sending to you a piece of code in orde to see more clear:
> <target name="get-input-files" 
>     depends="get-current-time"          
>     >          
>     <echo level="verbose"            
>         message= "Getting file: '${holder.prefix}${current.time}' from   server: ${server}"/>
>     <copy file="'borrame.txt'" tofile="'nuevo_borrame.txt'"/>          
>     <ftp action="get"              
>         server="${server}"             
>         userid="${login}"
>         password="${password}"              
>         verbose="yes"              
>         binary = "false"              
>         >              
>         <fileset dir=".">                
>             <include name="BORRAME.TXT"/>                
>             <include name="'PRVL.JSCHIT.L3BSCHI2.SALIDA.NNBAA.D060404'"/>     
>         </fileset>              
>         <!--fileset file="'${holder.prefix}${current.time}'"/-->          
>     </ftp>      
> </target>  
>   and I get the following output in debug mode:    
>   get-input-files:       
> [echo] Getting file: 'PRVL.JSCHIT.L3BSCHI2.SALIDA.NNBAA.D060404' from   server: aris.bsch
> [copy] P:\LRA\src\resource\'borrame.txt' omitted as   P:\LRA\src\resource\'nuevo_borrame.txt'
is up to date.        
> [ftp] Opening FTP connection to aris.bsch        
> [ftp] connected        
> [ftp] logging in to FTP server        
> [ftp] login succeeded        
> [ftp] getting files  Could not load a dependent class (com/sun/media/jai/codec/FileSeekableStream)
  for type
>  image  Could not load a dependent class (com/jcraft/jsch/UserInfo) for type sshexec
>  Could not load a dependent class (com/jcraft/jsch/UserInfo) for type scp  
>  Could not load a dependent class (jdepend/xmlui/JDepend) for type jdepend  fileset:

>  Setup scanner in dir P:\LRA\src\resource with patternSet{ includes:   
>  [BORRAME.TXT, PRVL.JSCHIT.L3BSCHI2.SALIDA.NNBAA.D060404] excludes: [] }  
>  filelist map used in listing files  filelist map used in listing files  
>  filelist map used in listing files        
>  [ftp] transferring BORRAME.TXT to P:\LRA\src\resource\BORRAME.TXT        
>  [ftp] File P:\LRA\src\resource\BORRAME.TXT copied from aris.bsch        
>  [ftp] 1 files retrieved        
>  [ftp] disconnecting    
>  as you can see the file name is changed for the ftp task but not for the copy   task.
>  Please let me know if the is any shortcut solution for this problem in the mean   
>  time you solve it for the next release.    
>  Thanks,    
>  David

> P.D.: I have reported this possible bug on:

I dont know if there is enough evidence to distinguish a bug in ant from 
some FTP server config.

1. try an <ftp list> to see if you can somehow get a listing that 
includes the file -include wildcards too if that helps.

2. use <scp> instead. It has a much more consistent way of listing 
directories than FTP servers.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message