FTP Stat vs mdtm

0 votes
asked Apr 18, 2013 by al duhuez (340 points)
edited Apr 19, 2013

Hi.

I'm using the latest Ftp module and had a quick question about STAT vs MDTM. In the past with some of the ftp servers that we connect too, MDTM was not supported. So we would fallback to STAT. In the Rebex api I see GetFileDateTime. Is there an api that maps to STAT? Secondly, what if MDTM is not supported, what does GetFileDateTime do?

thanks.

Applies to: Rebex FTP/SSL

1 Answer

+1 vote
answered Apr 19, 2013 by Jan Sotola (16,930 points)
edited Apr 19, 2013
 
Best answer

Rebex FTP does not use STAT in any method.

The STAT command (with a filespec argument) acts like the LIST command. Rebex FTP sometimes uses the LIST command in directory retrievals methods (GetList, GetRawList, GetItems), but it is never used when getting information about individual file or directory (like the GetFileDateTime method). More information can be found in this blogpost.

The GetFileDateTime first tries to call MLST command. If the MLST command is not supported by server, the MDTM command is called unconditionally. If the server does not support even the MDTM command, the GetFileDateTime fails with FtpException "Invalid command (500)".

commented Apr 19, 2013 by al duhuez (340 points)
edited Apr 19, 2013

Great, very informative, just what I was looking for. Thank you!

...