I Would be sending a signal to the server process stating the scp is over. I feel that would be a best method. But i am not sure as i have not dealt with such huge files across network.
Thanks
SasiKumar
Comment on Re: select, stat, and waiting for files
The problem with this approach is that the signal will probably appear before the file is actually completely written to the disk, due to the write-caching of most modern 'NIX systems. This makes it dangerous to assume anything based on the scp.
It doesn't matter whether the file is physically written to disk; the kernel will pretend that it is, and scp will use the kernel to access the file so will see it that way.
The only time having the file physically on disk would matter would be if the machine shut off unexpectedly, or if something was accessing the disk directly instead of using the kernel's filesystem drivers.