Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use the result code of FTP ?

Status
Not open for further replies.

lutech

Programmer
Jan 25, 2002
16
CA
I have all the FTP return codes, but I don't know how to use it to make sure a seccessful FTP transfer. For example:
ftp -ivn <<EOF >resultfile
open username passwd
cd dest_path
put file_name
quit
EOF
Since there will be more than one result code in &quot;resultfile&quot;, what can I do to ensure the file has been transferred succesfully?

Thanks in advancd.
 
When I want to be sure the ftp transfer is 100% sucessful I:
1. compute a checksum for the transfered file (command cksum) file_name before the transfer and put it into a file cksum_file_name
2. transfer a file_name
3. transfer a cksum_file_name
4. compute a checksum for an already transfered file
5. compar the new checksum and the checksum in a cksum_file_name

If the checksums are identical you are sure the file was not corrupted during the transfer.

mewa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top