View Single Post
Old 01-06-2016, 03:44 PM   #14
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
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.
eschwartz is offline   Reply With Quote