Skip to content

ftp: add MFMT support to preserve file modification time#5111

Open
peripherium wants to merge 1 commit intoMidnightCommander:masterfrom
peripherium:feature/ftp-mfmt-mtime
Open

ftp: add MFMT support to preserve file modification time#5111
peripherium wants to merge 1 commit intoMidnightCommander:masterfrom
peripherium:feature/ftp-mfmt-mtime

Conversation

@peripherium
Copy link
Copy Markdown
Contributor

@peripherium peripherium commented May 2, 2026

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

  • I have referenced the issue(s) resolved by this PR (if any)
  • I have signed-off my contribution with git commit --amend -s
  • Lint and unit tests pass locally with my changes (make indent && make check)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

… modification time on upload

Signed-off-by: Manuel Einfalt <einfalt1@proton.me>
@github-actions github-actions Bot added needs triage Needs triage by maintainers prio: medium Has the potential to affect progress labels May 2, 2026
@github-actions github-actions Bot added this to the Future Releases milestone May 2, 2026
@zyv zyv added area: vfs Virtual File System support and removed needs triage Needs triage by maintainers labels May 2, 2026
Copy link
Copy Markdown
Member

@zyv zyv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@zyv zyv modified the milestones: Future Releases, 4.9.0 May 2, 2026
@peripherium
Copy link
Copy Markdown
Contributor Author

Oh, this is a very nice little contribution, thank you!

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?

@zyv
Copy link
Copy Markdown
Member

zyv commented May 2, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: vfs Virtual File System support prio: medium Has the potential to affect progress

Development

Successfully merging this pull request may close these issues.

MC could really use FTP's MFMT command

2 participants