New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MFMT FTP command support. #201

Closed
giampaolo opened this Issue May 28, 2014 · 9 comments

Comments

Projects
None yet
2 participants
@giampaolo
Owner

giampaolo commented May 28, 2014

From btimby@gmail.com on January 20, 2012 22:47:34

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.

Original issue: http://code.google.com/p/pyftpdlib/issues/detail?id=201

@giampaolo giampaolo self-assigned this May 28, 2014

@giampaolo

This comment has been minimized.

Show comment
Hide comment
@giampaolo

giampaolo May 28, 2014

Owner

From g.rodola on January 21, 2012 09:38:01

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?

Labels: -Priority-Low Priority-Medium RFC

Owner

giampaolo commented May 28, 2014

From g.rodola on January 21, 2012 09:38:01

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?

Labels: -Priority-Low Priority-Medium RFC

@giampaolo

This comment has been minimized.

Show comment
Hide comment
@giampaolo

giampaolo May 28, 2014

Owner

From btimby@gmail.com on January 21, 2012 10:12:49

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).
Owner

giampaolo commented May 28, 2014

From btimby@gmail.com on January 21, 2012 10:12:49

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).
@giampaolo

This comment has been minimized.

Show comment
Hide comment
@giampaolo

giampaolo May 28, 2014

Owner

From g.rodola on January 21, 2012 10:23:49

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.

Status: Accepted

Owner

giampaolo commented May 28, 2014

From g.rodola on January 21, 2012 10:23:49

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.

Status: Accepted

@giampaolo

This comment has been minimized.

Show comment
Hide comment
@giampaolo

giampaolo May 28, 2014

Owner

From btimby@gmail.com on January 21, 2012 10:36:51

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.
Owner

giampaolo commented May 28, 2014

From btimby@gmail.com on January 21, 2012 10:36:51

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.
@giampaolo

This comment has been minimized.

Show comment
Hide comment
@giampaolo

giampaolo May 28, 2014

Owner

From g.rodola on February 29, 2012 07:54:49

Initial patch implementing MFMT command is in attachement.
Have to look into into it further as the unittest fails though.

Attachment: mfmt.patch

Owner

giampaolo commented May 28, 2014

From g.rodola on February 29, 2012 07:54:49

Initial patch implementing MFMT command is in attachement.
Have to look into into it further as the unittest fails though.

Attachment: mfmt.patch

@btimby

This comment has been minimized.

Show comment
Hide comment
@btimby

btimby Aug 1, 2017

@giampaolo Do you still have this patch for MFMT around? I assume the Google Code exporter did not include it here, and I can't find it.

Thanks.

btimby commented Aug 1, 2017

@giampaolo Do you still have this patch for MFMT around? I assume the Google Code exporter did not include it here, and I can't find it.

Thanks.

@giampaolo

This comment has been minimized.

Show comment
Hide comment
@giampaolo

giampaolo Aug 1, 2017

Owner

Hey Ben, glad to hear from you! =)
Oh! It seems Google Code is definitively gone for good, and no, I no longer have that patch. :(
More or less, in order to implement this:

  1. The filesystem class should expose an utime method: https://docs.python.org/3/library/os.html#os.utime

  2. The authorizer has to expose a new permission. Right now we have

    read_perms = "elr"
    write_perms = "adfmwM"

Being MFMT an "unofficial" command the new letter has to be capitalized (maybe "T"?).

  1. As per https://tools.ietf.org/html/draft-somers-ftp-mfxx-04 there's also MFMC (modify creation time); not sure if we want that too but if I'm not mistaken file creation time is not supported on UNIX (but it should be on Windows). I'd be OK with implementing MFMT only for now, and think about MFMC later, and if we do it can simply be a no-op on UNIX.

This is the rough idea. I'm not sure I'll have time to work on this anytime soon though as I'm going to China and will stay "out" for the next couple of months.

Owner

giampaolo commented Aug 1, 2017

Hey Ben, glad to hear from you! =)
Oh! It seems Google Code is definitively gone for good, and no, I no longer have that patch. :(
More or less, in order to implement this:

  1. The filesystem class should expose an utime method: https://docs.python.org/3/library/os.html#os.utime

  2. The authorizer has to expose a new permission. Right now we have

    read_perms = "elr"
    write_perms = "adfmwM"

Being MFMT an "unofficial" command the new letter has to be capitalized (maybe "T"?).

  1. As per https://tools.ietf.org/html/draft-somers-ftp-mfxx-04 there's also MFMC (modify creation time); not sure if we want that too but if I'm not mistaken file creation time is not supported on UNIX (but it should be on Windows). I'd be OK with implementing MFMT only for now, and think about MFMC later, and if we do it can simply be a no-op on UNIX.

This is the rough idea. I'm not sure I'll have time to work on this anytime soon though as I'm going to China and will stay "out" for the next couple of months.

@btimby

This comment has been minimized.

Show comment
Hide comment
@btimby

btimby Aug 1, 2017

Thanks for the reply, I am not sure if we need this or not, I really just wanted to know if you had the old patch or not (my email does not go back that far). So don't worry about this at all.

Have fun in China, I am sure it will be quite an experience.

btimby commented Aug 1, 2017

Thanks for the reply, I am not sure if we need this or not, I really just wanted to know if you had the old patch or not (my email does not go back that far). So don't worry about this at all.

Have fun in China, I am sure it will be quite an experience.

giampaolo added a commit that referenced this issue Oct 9, 2017

@giampaolo

This comment has been minimized.

Show comment
Hide comment
@giampaolo

giampaolo Oct 9, 2017

Owner

Implemented in #434.

Owner

giampaolo commented Oct 9, 2017

Implemented in #434.

@giampaolo giampaolo closed this Oct 9, 2017

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