0 votes
by (340 points)
edited

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
by (18.1k points)
edited
 
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)".

by (340 points)
edited

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

...