Hello,
I copy files from FTP server (SFTP-connection) and sometimes get an error ("Unexpected size of data stream") - files can be updated during sync. Can I supress it and copy files anyway?
SFTP Unexpected size of data stream
- Posts: 4
- Joined: 21 Apr 2016
- Posts: 4
- Joined: 21 Apr 2016
For example, WinSCP does it without such an error.
- Site Admin
- Posts: 7211
- Joined: 9 Dec 2007
The error indicates data corruption, so this is not something to be ignored. Either the file size reported by the SFTP folder is wrong (stat) or the data retrieved is invalid (read), in the best case only returning short or adding superfluous bytes.
- Posts: 4
- Joined: 21 Apr 2016
The problem is that the file I've been copying, is frequently updated, so the size differs. Can ffs copy all the file not regarding to it's size at the beginning of the sync?
- Site Admin
- Posts: 7211
- Joined: 9 Dec 2007
FFS opens the file handle, retrieves the file size and then starts copying the file, it does not consider the file size of the time of comparison. If there is still a mismatch it means the file was changed while the file copy is in progress, so data is very likely partially invalid.
- Posts: 4
- Joined: 21 Apr 2016
Thanks!