Page 1 of 1

Permission denied??

Posted: 28 Dec 2017 14:49
by digitalstone
I'm using the "init variable text file" to read the charging battery current at:
/sys/class/power_supply/battery/current_now

Whenever i execute it says "permission denied".

I'm using a rooted Nexus 5X - Vanilla Android

Re: Permission denied??

Posted: 28 Dec 2017 15:45
by Desmanto
That won't work, as general action of init and several files related operation are executed under normal user permission.
To access any file within root user permission, you must always use execute root command. (which mean we must know the command line alternatives)

To init the value of the current, use execute root command

Code: Select all

cat sys/class/power_supply/battery/current_now
check the {stdout} for the value.

Re: Permission denied??

Posted: 28 Dec 2017 18:00
by digitalstone
Desmanto wrote:That won't work, as general action of init and several files related operation are executed under normal user permission.
To access any file within root user permission, you must always use execute root command. (which mean we must know the command line alternatives)

To init the value of the current, use execute root command

Code: Select all

cat sys/class/power_supply/battery/current_now
check the {stdout} for the value.
Oh boy, i'm a Linux noob so i know why i didn't feel this one out.
But thanks a bunch. It works now.

Little question though, i know of 'su' being used for interpreting super user commands.
But what does 'cat' stand for (other than your thumbnail :D )

Re: Permission denied??

Posted: 29 Dec 2017 01:59
by Desmanto
I am not quite familiar with linux too. Was forced to learn it bit by bit because of android. Most of the time I just google out the command using "android terminal" keyword. For example this cat command was found using "android terminal show file content"

cat command came from "concatenate" (some may say "catenate"). It supposed to be used to concatenate several files at once, and show them at the standard output. But somehow nowadays it usually used to show the content of a file.

Hehehe :D , this cat has been my avatar since I active in other forum. It is easier for others to spot my post. (they said so) So i just kinda make it as my unique signature.

Re: Permission denied??

Posted: 31 Dec 2017 19:12
by digitalstone
Desmanto wrote:I am not quite familiar with linux too. Was forced to learn it bit by bit because of android. Most of the time I just google out the command using "android terminal" keyword. For example this cat command was found using "android terminal show file content"

cat command came from "concatenate" (some may say "catenate"). It supposed to be used to concatenate several files at once, and show them at the standard output. But somehow nowadays it usually used to show the content of a file.

Hehehe :D , this cat has been my avatar since I active in other forum. It is easier for others to spot my post. (they said so) So i just kinda make it as my unique signature.
Sorry for the late reply. But alright, so it's just "on of these things" that you just have to know :)

New years eve has arrived, so with this i wish best of luck going through 2018 to you + cat (if yours) and anyone who reads this in 2017 (no time machine from future allowed).