The algorithms that sum originally used have been discredited. If you use the sum command, use -p so that you get a crc check. Or just use cksum instead. The crc algorithm is the champ as far as detecting data corruption. That is why the TCP layer is performing a crc on
every arriving packet.
The only time I have ever seen the "flag file" used is to know when the last of a collection of files have arrived. Once the flag file appears, you know that you have everything and you can use the data. I do not understand why your colleague's advice in this case. You will have to ask him to explain.
Nor do I understand your fixation on the the 226 return code. I am unable to tell if you think 226 means that file was transferred ok or if you think that 226 means there was a problem. But that doesn't matter, neither view is correct.
According to the rfc:
Quote:
226 Closing data connection.
Requested file action successful (for example, file transfer or file abort).
226 really just means that the data connection is closed. In the case of an abort, it is clear that the file has not been transferred. It is common to close the data connection after a file has been transferred, but it is not required. The data connection is not held open for all eternity under any conditions. If you open a data connection, the time will come that it is closed.
Quote:
The data connection shall be closed by the server under the conditions described in the Section on Establishing Data Connections. If the data connection is to be closed following a data transfer where closing the connection is not required to indicate the end-of-file, the server must do so immediately. Waiting until after a new transfer command is not permitted because the user-process will have already tested the data connection to see if it needs to do a "listen"; (remember that the user must "listen" on a closed data port BEFORE sending the transfer request). To prevent a race condition here, the server sends a reply (226) after closing the data connection (or if the connection is left open, a "file transfer completed" reply (250) and the user-PI should wait for one of these replies before issuing a new transfer command).
Paying close attention to the arrivial of a 226 would be crucial if you were writing an ftp client. That is not what you're doing.