Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FTP "ls -lt" command: How does it list the file details for Linux FTP and Windows FTP server?

I am writing FTP client that should work for at least Windows and Linux FTPs. BUt before I proceed, I want answer to these questions.

  1. In which order files are listed when FTP ls -lt command is used for the FTP server on the Linux?
  2. Is there any specific format/logic in which all Linux FTP servers provide the list of files? e.g. DateTime stamp is going to be there always and files are listed in the descending order of the "date modfied" or something like this.
  3. In which order files are listed when FTP ls -lt command is used for the FTP server on the Windows?
  4. Is there any specific format/logic in which all Windows FTP servers provide the list of files?
  5. Can you direct me to some documentation which helps to understand this? Is there any standard defined for this?

Note: I tried command on Windows and Linux FTP servers but I could not figure out any specific logic/format.

like image 274
Learner Avatar asked Jul 19 '12 04:07

Learner


1 Answers

ls is a client command. When your client gets ls -lt from the user, you issue a LIST command to the server and it's up to your client to parse the data returned and sort it by time. The data returned by the ftp server when you use the LIST command is similar to the output of ls, but it can vary from server to server. See: http://cr.yp.to/ftp/list.html

like image 142
Jon Lin Avatar answered Sep 28 '22 00:09

Jon Lin