0

我通过 ADB 无线登录到一个 android 设备,我是 root。我在 /sys/devices/platform/musb_hdrc/ 试图修改一个名为 mode 的文件。当我将某些内容通过管道传输到文件中时,它返回没有错误,但文件未修改。当我将某些内容导入新文件时,我得到“目录不存在”。这是怎么回事?

# 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
# 
4

1 回答 1

1

/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.

于 2012-11-12T00:10:46.230 回答