Re: Using JS to write to file under /sys



Il 29/07/2012 15:37, Иво Георгиев ha scritto:
/sys is a special filesystem, and it seems Gio has some trouble with
it. Keep in mind, writing into a file in /sys might give back an
"invalid argument" error if you're trying to set something in an
incorrect way.
Anyway, I can think of two solutions: use another library for writing
to files OR spawn an echo. Spawning a new process (shell with "echo 1
>/sys/something") is not THAT horrible - sure, it's not an elegant

Thanks a lot, much appreciated!

Could you recommend a library that is not GIO or GLIb (both didn't work) and gets the work done in JS before I turn to the "echo" solution? If you can, that would be sweet :)

Second question: how to give permissions to such a program? Am I supposed to run it as "pkexec program.js", or should I just do some magic inside the JS to give higher permission only to the small bits of code that actually need it? If the case is the latter, could anybody enlighten me on the particular magic required?

Thanks again!

Alessandro


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]