How to check a file status?
Hello.
Please help me with the question:
I am getting files from a directory, then I have to process them one by one (copy, move to another folder, and etc.). Before I will do anything with a file I must check if the file is not involved in any process (suppose it is already open or loading from another folder). If the file is under any process it should me moved to the end of its current directory and the second file should be processed; if it is the last file - program should pause and start over when the file will be available to process (I mean someone close the file or the file will be loaded completely).
The code should run in an automatic cycle, without any interaction with a user.
If it is hard maybe somebody knows how to check the file status. Spent a lot of time but did not find any useful information.
Thank you.
|