How do I check in UNIX, if an FTP process has finished output data to a file before I grab that file for the further process?