I’m putting together something to download some files over SFTP. I’m using PuTTY’s psftp.exe command.
When I do a dir/ls in PSFTP, is the format of the output standardized, either by SFTP or by PSFTP itself? Or is it just whatever free-form text the server happens to send in response?
I ask because I believe in FTP (way back when!), it was not at all standardized, and I only have one SFTP server here to test against.
Unlike FTP (which used textLISToutput), the SFTP protocol is based on binary structures, so Putty is doing all the formatting. Specifically, it uses the SSH_FXP_READDIR command to read directory entries, which are returned in the format specified by SSH_FXP_NAME.Ideally you would use an API, rather than psftp. But if you choose to parse the text, you have PuTTY and only PuTTY to worry about.
My mistake. The newer draft I looked at does not have such a text
longnamefield. However, older versions do.