According to RFC959 the STAT command can be used with a pathname (and without while transfer is ongoing). I think your problem in the sample output is, that your FTP command client is not really issuing a STAT command. I would recommand you use a raw TCP connection like netcat/telnet to debug the command or at least use "QUOTE STAT /filename" if the client supports it.
I think it is rarely used for its actual return code as it is hard to parse but it is used as a NOP-like command to keep control connection active or signal interactions after file transfers (some servers need that to recognize complete transfers). BTW, I think this is a users-list question. Bernd -- http://bernd.eckenfels.net -----Original Message----- From: Clark Stuth <clarkst...@carfax.com> To: "dev@commons.apache.org" <dev@commons.apache.org> Sent: Di., 07 Juni 2016 21:53 Subject: [NET] - FtpClient.getStatus(path) does not seem to be working as documented. We think we've identified a mis-documented feature with FTPClient in commons-net, specifically the getStatus() methods. According to the FTP protocol, STAT should return server status information. However, according to the FTPClient documentation (https://github.com/apache/commons-net/blob/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java#L3510), the STAT command is used to retrieve remote file listings. As a result, we are running into an issue with how Spring Framework Integration is using the FtpClient.getStatus(path) command. >From our own testing it does not appear that the FTP Server's stat() command returns a different result when presented with a pathname or not. The STAT command primarily seems to return server and connection status information, not file information. The following two examples will show the FTP Server Output when presented with the STAT command against no path, a file that exists, and an invalid path (file does not exist). OpenVMS Implementation: https://raw.githubusercontent.com/clarkstuth/spring-ftp-template-spike/master/status_command_OpenVMS.txt PureFTPD Implementation: https://raw.githubusercontent.com/clarkstuth/spring-ftp-template-spike/master/status_command_PureFTPD.txt Is it possible we are misinterpreting what this stat command should be doing? It appears the FTP protocol functions differently than how this method is documented. If the functionality of the STAT command is vendor dependent, would it be possible to update the documentation to include this? Thanks, Clark Stuth, Sean Lally Carfax Software --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org