-1

How can i edit the file in the sys directory using JNI and NDk in android. Actually i Need to edit these file "/sys/class/gpio/gpio41/value".

Rune FS
  • 21,497
  • 7
  • 62
  • 96
user1925921
  • 120
  • 1
  • 10
  • 1
    NDK or not, this is not doable on a non-rooted device. Once the device is rooted, however, it's regular file I/O. Are you stuck on the latter? – Seva Alekseyev Feb 15 '13 at 02:14
  • @SevaAlekseyev By changing the mode I can nw edit the file using: chmod 777 /sys/class/gpio/gpio41/value – user1925921 Feb 15 '13 at 05:11
  • OK, so what's your question now? By the way, when the situation changes, it's better to edit the question rather than write comments. – Seva Alekseyev Feb 18 '13 at 17:37

2 Answers2

0

just a little hint: use chmod 666 ... You will get read/write permission but you don't need execute permission on HW-pins.

Regards Martin

0

By changing the mode you can now edit the file using: chmod 777 /sys/class/gpio/gpio41/value

Rune FS
  • 21,497
  • 7
  • 62
  • 96
vinu
  • 71
  • 1
  • 11