Your method is one way. I would take a different way and have the .iso creation process also create a second file, .iso.ok, which tells you that the .iso has been created completely. Another way would be to create the .iso in a second directory and then rename it into the pickup directory.
If you also have an ssh or telnet login to the remote site you could use the UNIX lsof command to see whether the file is open for writing by a specific process. For example, say your file is /tmp/test.iso, you could run
lsof /tmp/test.isoWhich would give something like this:
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME isowrite 12533 root 3w REG 254,1 0 235 /tmp/test.iso
The FD entry shows you that the file is opened for writing by the isowrite process.
Not the most elegant method either ([Corion]s solution is better, but requires that you have some control over the iso-creating process), but more reliable than checking for size change.
You may view the original node and the consideration vote tally.
But as others have pointed out, the best solution is to make a slight change in the process that creates the iso file: the directory or name of the file being created should be different from the directory or name used to download the file; just add a step after the "mkisofs" or whatever, to rename/move the completed file so that the download process will only find it after it's finished.
perlmonks.org content © perlmonks.org and Corion, graff, NodeReaper, tirwhan, xuepengduan
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03