WinSCP sftp file size attribute

Advertisement

pszafranski
Guest

WinSCP sftp file size attribute

WinSCP' sftp always uses the original file size in SSH_FILEXFER_ATTR_SIZE, even for ASCII transfers when some bytes (record delimiters) may be stripped or converted as part of this type of transmission. If the receiving side is monitoring the number of bytes received and compares it to the original number of bytes reported in the file attributes, there is a mismatch. Would it be possible to report the number of bytes in file attributes by WinSCP after the conversion of a file to ASCII takes place so it matches the number of bytes sent, or not report it at all if it cannot be determined.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: WinSCP sftp file size attribute

SFTP specification says:

The `size' field specifies the size of the file on disk, in bytes. If it is present during file creation, it should be considered a hint as to the files eventual size.

Files opened with the SSH_FXF_TEXT flag may have a size that is greater or less than the value of the size field.

So I believe that that server should not compare bytes received with the size field.

What SFTP server has this problem?

Reply with quote

Advertisement

You can post new topics in this forum