It is necessary that once in a certain folder something has changed, immediately execute the code.
That is, I change the files in the project, add, delete folders and immediately need to change the updated.txt file by writing the update time to it.
2 answers
In the loop, check the size of the files (FileInfo.Length) in the desired directory, when changing, analyze the changed file and write the changes to updated.txt. For the first time, make a cast of what is. Next catch new files or changes.
|
Ready C # program that tracks changes
http://www.codeproject.com/Articles/26528/C-Application-to-Watch-a-File-or-Directory-using-F
- Are you so popular with your project? - Nick Volynkin ♦
- @ "Nick Volynkin" - I do not understand, why minusovat answer, if it is on the topic. The source is not at all mine in fact, and no one is promoting anything. Here they suggested toster.ru/q/341170?e=4178854#answer_item_858564 . - Rakzin Roman
- the cons are not mine, I just posted a comment) - Nick Volynkin ♦
- I think the disadvantages are for two reasons: this is only a link, which is not enough for an answer, and 2) is slightly similar to self-promotion. I propose either to expand the answer, or leave a link in the comments. - Nick Volynkin ♦
- github.com/fsnotify/fsnotify github.com/jpillora/spy - Rakzin Roman
|
watchmedouse the utility (cross-platform, implemented on Python) (allows you to run a command if the specified events ("something has changed in a certain folder") occurred). - jfs