Set modified timestamp when moving resource from ftp -> file

Review Request #111016 - Created June 14, 2013 and submitted

Information
Dawit Alemayehu
kdelibs
KDE/4.10
55804
Reviewers
kdelibs
dfaure
This attached patch sets the modified timestamp on files moved from ftp servers to local file. Unfortunately, doing the same the other way around is a complete mess. That is because setting timestamp on FTP servers is anything but straight forward and there are 3 ways you can do it depending on the particular FTP server or how it is configured!

Here are the three commands:

1.) MDTM command (not recommended). Using this command to set the modified timestamp completely goes against the RFC that defines it, RFC 3695. However, that does not stop some servers like Microsoft's and vsftpd from doing just exactly that!

2.) MFMT command (recommended). This command was defined to do exactly what MDTM was not! Set the modified timestamp of a file on the FTP server. Though it never made it into a standards track RFC, it was defined in a draft IETF standard and seems to have been implemented by several FTP servers.

3.) SITE UTIME command (????). This command seems to have originated in NcFtpd and later adapted by other FTP servers for compatibility sake. 

Anyhow, I am sure it is clear from the above listings that this can be a nightmare to deal with. Most client ftp software seem to simply implement support for all three and use the one the server supports by checking its response to the FEAT command. Until we do something similar, this patch will have to do.

  
David Faure
Commit Hook
Dawit Alemayehu
Review request changed

Status: Closed (submitted)

Loading...