Using FTP connection, is there a specification that defines what does the last modification time stamp mean?

In particular, in case if uploading new file, does it specify the moment in time when the file was created, or when the last write to the file/stream was performed?

  • This seems like a really easy thing for you to test. It also could potentially depend on the ftp server. – Andrew Schulman Oct 1 '14 at 6:09
  • @AndrewSchulman indeed a test is trivial, but I am looking for a spec to conform our API to. – acalypso Oct 1 '14 at 8:55

Section 3 of RFC 3659 describes the MDTM command for retrieving the file modification time. It doesn't say anything about which operations update the modification time, or when during those operations the update occurs. So it's up to the server OS. I would expect most operating systems to use the time of the last write to the file.

If you want the file creation time, you should use the MLST command, and look for the Create fact in the response. However, some operating systems may not be able to provide this. Most Unix filesystems don't store the file creation time, only the modification time, inode change time, and access time.

  • Thank you Barmar, so it seems we cannot have a clear rule here in place. What I am specifically interested in is that the modification time will never return the file creation and always returns last write. It seems this may not be the case, which I believe answers my question. – acalypso Oct 1 '14 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.