This month's Index
Subject: scp_write example is incomplete.
scp_write example is incomplete.
From: Frasse <frasse_at_fworld.se>
Date: Tue, 04 Nov 2014 09:07:46 GMT
The scp_write example is incomplete.
According to the scp spec a completed file transfer should be followed by a single 0 that the remote machine acknowledge with a status of 0,1 or 2. If the status is not 0 then an error message can follow ending with a linefeed.
I couldn't understand why I got no indication that my uploads failed when the disk on the remote machine was full. The answer was that the code never requested the acknowledgement.
I am attaching a modified version of the example that writes out the error message to stderr.