How can I know a file is ready?
Posted: Wed Apr 13, 2011 9:36 am
Hi,
I have a php module which watches a folder, and when a file is shown in the folder, the module will process the file.
The file could be very large, and need some time to be written completely into the folder. The watching module could detect the file when the file is written partially into the folder, and it should wait until the file is completely written.
So the problem here is that how the watching module can learn the file is partial or complete?
A file lock may work, but I need a solution simpler? Is there any file property which I can test to learn the file status.
Thanks,
I have a php module which watches a folder, and when a file is shown in the folder, the module will process the file.
The file could be very large, and need some time to be written completely into the folder. The watching module could detect the file when the file is written partially into the folder, and it should wait until the file is completely written.
So the problem here is that how the watching module can learn the file is partial or complete?
A file lock may work, but I need a solution simpler? Is there any file property which I can test to learn the file status.
Thanks,