in reply to Treat a directory as file queue

How can I ensure I only copy file which is a complete file? Because the file size is very large, I might copy some file which is still in the process of being copied from End-users' directory to that directory.

If you are incontrol of the upload process, there is a quick and easy way that I'd do it. NOTE: This is not tested, only a theory. There is an old way of doing things in C called flags. Since you are in control of the copying,

  1. set a flag that references a file that is going to be uploaded.
  2. Start the copy
  3. unset the flag .5 seconds after the copy returns successful.
    • If unsuccessful, do your own error checking thing

OR

Do a md5sum on both files every few seconds until the sums match. The md5sum is much much slower.

Just a thought

Kristofer