Re: Python - Simple method of detection file changes
I don't know if this is what you want. But I would track the time you edited the file and possibly the size and save the files last edited time and store it in a database or another file or something.
Then every so often check that they match up.
If they don't then, compare them line by line, until you find a change.
I know this is not really what you asked for.. because that was probably the solution you originally had in mind.
And if you have lots of tiny files in many sub-directorys it could be a lot of processing overhead, waste of hard disk seek time and could take quite a while.
I actually have created a database and stored all my files in it as blobs. their file size, name, location, last modified, user who modified etc. and I log the INSERT, UPDATE & DELETES to a history table which is managed by triggers. So this would serve me fine for that purpose. However this will not work with the traditional filesystem.
Uses: Jaunty J 9.04 & Maverick 10.10
Bookmarks