ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 6639] - FTP GET assumes a leading whitespace with files older than a year
Date Wed, 23 Oct 2002 20:04:21 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6639>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6639

FTP GET assumes a leading whitespace with files older than a year

chris@strahorn.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chris@strahorn.com
             Status|RESOLVED                    |VERIFIED



------- Additional Comments From chris@strahorn.com  2002-10-23 20:04 -------
Reproduced this bug. It's a nasty edge case specific to AIX 4.3 and files 
greater than six months old, that exposes a bug in the ftp library.

On AIX 4.3, for files that are greater than six months old, the ls command 
switches to displaying the modification year instead of the modification time. 
This year takes up a maximum of four characters, e.g. 2002, as opposed to the 
maximum of five characters present in the time, e.g. 14:37.  For files like 
this, AIX's ls adds a second space to seperate the modification year and the 
file name. This breaks an assumption in the ftp library. See 
org/apache/commons/net/ftp/DefaultFTPFileListParser.java, line 323 - 326 of 
version 1.2 in the Commons/Net sandbox, for a comment indicating the assumption 
and the source of the problem.

What happens is that in org/apache/tools/ant/taskdefs/optional/net/FTP.java, in 
the inner class FTPDirectoryScanner's method scandir(), a call is made out to 
the FTPClient's listFiles() method (line 216 in version 1.29) to get a list of 
files present on the server. The FTPClient in turn uses an instance of the 
DefaultFTPFileListParser class to parse out the file names.  When connecting to 
an AIX 4.3 server and looking for files greater than six months old, 
DefaultFTPFileListParser misparses the output, causing an extra space to be 
prepended to the file name as indicated by the original submitter. In my 
particular case, the include attribute in the ftp tasks FileSet element is 
include="myjar.jar". This fails to match as the server find a file called " 
myjar.jar". Changing the include line to include="*myjar.jar" causes the file 
to be matched, but when a get is attempted for " myjar.jar" it fails as no file 
with that name exists.

Simple workaround is to touch the files so that the modification time is not 
greater than 6 months in the past.

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message