Is the (P) SFTP dir / ls standard format standard?

I am collecting something to upload some files via SFTP. I am using the PuTTY psftp.exe .

When I do dir / ls in PSFTP, is the standardized output format either SFTP or PSFTP itself? Or is it just some free-form text that the server sends back?

I ask because I believe in FTP (the way back!), It was not standardized at all, and I have only one SFTP server for testing.

+4
source share
2 answers

Unlike FTP (which used LIST text output), SFTP is based on binary structures, so Putty does all the formatting. In particular, it uses the SSH_FXP_READDIR command to read directory entries that are returned in the format specified by SSH_FXP_NAME .

Ideally, you should use the API, not psftp. But if you decide to parse the text, you have PuTTY and only PuTTY to worry about.

My mistake. The newer project I was looking at does not have such a longname text field. However, older versions .

+2
source

Matthew, the local client can choose to display information in the long name slots from the SSH_FXP_NAME response instead of generating it locally from the file name and attrs slots.

Despite the way psftp does this internally, you cannot be completely sure that its format will not change when connected to another server.

+2
source

Source: https://habr.com/ru/post/1315255/


All Articles