ftp: add MFMT support to preserve file modification time#5111
ftp: add MFMT support to preserve file modification time#5111peripherium wants to merge 1 commit intoMidnightCommander:masterfrom
Conversation
… modification time on upload Signed-off-by: Manuel Einfalt <einfalt1@proton.me>
zyv
left a comment
There was a problem hiding this comment.
Oh, this is a very nice little contribution, thank you!
I'm not sure if anyone still uses FTP these days, with usernames and passwords traveling unencrypted over the wire... we don't even support FTPS, unfortunately. But it does no harm to support modification times with little effort.
Unfortunately, this PR is blocked on CI because of the latest C23 changes. We'll have to fix this first.
Thanks for the kind words! Regarding FTP: I agree it's mostly legacy, but I still use it occasionally in a private, closed home network together with mc, and I suspect I'm not entirely alone there. In such setups, having correct modification times can be a useful bit of extra information, for example when dealing with backups or archived data. Out of curiosity: is the lack of FTPS support a deliberate decision, or just something that hasn't been implemented yet? |
Nothing deliberate, just a lack of interest and resources (see #3343)... after SFTP got implemented (even though it's in a sorry state right now - see #3654). Besides, I guess we'll have to add a direct dependency on some crypto if we want to support it. |
This adds support for the FTP MFMT command to set the remote modification time after upload.
The command is always sent after upload; if the server does not support MFMT, the response is ignored and no error is raised. This does not cause any malfunction or error messages in mc.
Checklist
git commit --amend -smake indent && make check)