This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HELP! Weird bug in commons.net.ftp

 
Philippe Desrosiers
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been using commons.net.ftp.FTPClient for over a year now, without any problems. Suddenly, when calling FTPClient.listFiles(), some of the entries in the returned list are NULLs (ie: some of the files on the server are listed, and some result in NULLs). But FTPClient.listNames() returns the filenames correctly! I'm at my wits end. Has anyone else had this problem before?

Here's some sample code:
 
Paul Clapham
Sheriff
Pie
Posts: 20966
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What changed on your server?
 
Philippe Desrosiers
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nothing. But files that were uploaded before yesterday are working fine (they show up in the .listFiles() results), and files that were added since then are returning NULLs in the .listFiles() results (one NULL entry for each file). So I get a mix of normal FTPFile instances, and NULLs.
 
Philippe Desrosiers
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
update: If I call .listNames(), then cycle through the results, calling .listFiles for each filename, I get an empty array for each problem file...

so like:
 
Paul Clapham
Sheriff
Pie
Posts: 20966
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Philippe Desrosiers:
nothing.
No, something changed on your server. For example, there are different files on the server today than were there yesterday. And for example today is February 29 and not February 28, although you wouldn't think that software would have leap-year problems after all these years. Something is different.

Have you tried connecting to the FTP server from the command line and doing a DIR command to see what you can see?
 
David Sing
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've just started using the commons net FTPClient in the past two days and today experienced this same problem with files that have a Feb 29 timestamp. Everything has pointed to a leap-year problem with commons.net.ftp.FTPClient.

All other FTP clients have no problems on the same server (not controlled by me but used by '00s of others).

At least it won't bother us again for another 4 years

Dave
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic