file transfer ends

how can I tell when a ftp/sftp file has completed - I'm having trouble by picking up a file that is still being transferred to - is there a better way to transfer files across systems???

Have you tried the toggling the hash command in ftp. Shows the transfer of data.

vino

sorry I did not explain what I need - I concerned with knowing when the file transfer is completed from the perspective of the remote system not the originating system. We have automatic daemons searching the directories are looking for transferred files but HOW DO THEY KNOW WHEN THE file has been completely transferred???
THANKS-

rename the file upon complete ftp to denote a complete file

### Function to check if ftp was successful ### For Unix and NT
chk_ftp() {
grep -i 'Transfer complete' $TMP_DIR/ftpout.$$.log
transfer_code1=$?
echo $transfer_code1

grep -i 'Transfer finished' $TMP_DIR/ftpout.$$.log
transfer_code2=$?
echo $transfer_code2

if [ $transfer_code1 -eq 0 -o $transfer_code2 -eq 0 ]
then
echo "Successful Transfer!"
else
MessageFile="Transfer failed or data was truncated for: "
echo $MessageFile >$2
exit 14
fi
}

# Begin actual FTP process
`ftp -nv $Site <<EOT > $TMP_DIR/ftpout.$$.log 2>> $TMP_DIR/ftperr.log
user $User $Password
put $SourceFile $DestFile
bye
EOT`

# call function
chk_ftp