Page 1 of 1

Decorator for write access to protected files

Posted: Fri May 24, 2019 12:43 pm
by KnightOfPi
Hi all!

I always had problems when i tried to automate installation routines for RPi applications when i tried to read and write protected fiels like wpa_supplicant.conf for automated network setup.
So, there might be better ways , but i wrote a Python decorator which gives functions access to all protected files.

If you think that's useful for your tasks, you can find it here:
http://www.knight-of-pi.org/decorator-f ... tem-files/

Happy Hacking!

Re: Decorator for write access to protected files

Posted: Fri May 24, 2019 1:01 pm
by Andyroo
Risky but handy :lol:

Next version - automatic backup of changed files?

Re: Decorator for write access to protected files

Posted: Fri May 24, 2019 2:31 pm
by scruss
Handy indeed. Some system files won't work as expected if you chgrp/chmod them away from their standard values: I'm thinking particularly of the sudoers file. Caveat [whatever latin for 'user' is].