Checking for the pre-existing permissions only of files that are already slated to be added and cleaned up?
We don't care about preserving the mtime if it is being deleted, do we...
On the separate topic of efficiency, I had/have no qualms.
Anyway, you'd lose time when you stat the current permissions, and gain time if you can skip writing new permissions to an already-rw file.
You'd save time by not writing+deleting the flag file if only already-rw files are there.
Neither matters unless the plugin wakes up right after you add a rw file and before the auto-add finishes processing it. Unlikely timing.
With the extra (wasted?) stat calls, you might actually lose time. I'm not sure if os.stat is faster than os.chmod, if not then you always lose.
|