Reputation: 10287
I'm logged into an android device via ADB wireless and I'm root. I'm in /sys/devices/platform/musb_hdrc/ trying to modify a file called mode. When I pipe something into the file, it returns without error, but the file is unmodified. And when I pipe something into a new file, I get "directory nonexistent". What's going on?
# ls -l mode
-rwxrwxrwx root root 4096 2012-11-11 14:39 mode
# cat mode
b_peripheral
# echo foobar
foobar
# echo foobar > mode
# cat mode
b_peripheral
# echo foobar > myfile
cannot create myfile: directory nonexistent
#
Upvotes: 0
Views: 330
Reputation: 23556
/sys is not a real directory with real files, it's the convenient interface to the kernel functions, exported as file system. some files are writable, but most of them are read-only and you're not supposed to create any files there yourself because, once again, it's not a real file system.
Upvotes: 1