New issue 201 by bti...@gmail.com: MFMT FTP command support.
http://code.google.com/p/pyftpdlib/issues/detail?id=201
Any thoughts on implementing MFMT and friends?
http://www.omz13.com/downloads/draft-somers-ftp-mfxx-02.html#MFMT
These are useful for file synchronization over FTP.
I had someone request it and might go ahead and send a patch if you are
open to it. Otherwise if you have feedback for or against, I would like to
hear it.
Thanks.
Comment #1 on issue 201 by g.rodola: MFMT FTP command support.
http://code.google.com/p/pyftpdlib/issues/detail?id=201
That's controversial as that's a non-standard, experimental and expired
(January 29, 2009) draft:
http://www.omz13.com/downloads/draft-somers-ftp-mfxx-04.html
...but on the other hand I see proftpd implements MFF and MFMT by default:
http://www.proftpd.org/docs/modules/mod_facts.html
AFAIK, there's no such thing as file creation time on Linux:
http://unix.stackexchange.com/questions/24441/get-file-created-creation-time
http://www.cyberciti.biz/tips/understanding-unixlinux-filesystem-inodes.html
http://stackoverflow.com/questions/5929419/how-to-get-file-creation-date-in-linux
File modification time is available; how would you change it though? You'd
open the file in append mode and then close it?
Also I'm wondering: why would anybody want to change file
create/modification time in the first place?
As well, FileZilla supports setting mtme using MFMT.
You are correct here of course. Changing the mtime is really the only
useful part of this spec.
You can set the time by using os.utime().
The common use-case is file synchronization. The sync software will
set the modification time on the server to match that of the client.
Then the sync software can compare times to see if local or remote
changes have occurred (the mtime will become out-of-sync if either
side is modified).
Comment #3 on issue 201 by g.rodola: MFMT FTP command support.
http://code.google.com/p/pyftpdlib/issues/detail?id=201
Since os.utime appears to be present on both POSIX and Windows, and given
the you case you described since reasonable, I think we should implement
this (MFMT / edit file modification time).
I looking at the spec and it's not clear to me what MFF is for.
I think for modifying more than one fact at a time. However, since
MFCT is not useful on POSIX systems (or at least Linux) we are
probably not interested in it or MFF.
Initial patch implementing MFMT command is in attachement.
Have to look into into it further as the unittest fails though.
Attachments:
mfmt.patch 5.3 KB