[BONE]Why canNOT edit LED's trigger file with vi ?

Hi all
I see the LED's trigger file is a text file:
$ file trigger
trigger: ASCII text

But why can not edit it with vi?
Why must do "echo none > trigger "?

A normal flat text file with operation "echo none > file",
we should get the string "none" in it.
But why I get "
[none] mmc0 timer heartbeat backlight gpio default-on
"
in it ?

Thank you.

Roka

I believe the reason you can’t edit the file with VI is because its a streaming file (wich is protected).

I dont know for sure but you should add quotations around none in order to cast it into the file properly (echo “none” > trigger)

I guess your are talking about sysfs file.
These are something like sockets: you can write (echo) and read (cat) from those but you cannot seek through them (edit). They are here to provide easy and practical access to system settings.

Technically, you can read from the file and seek to the beginning to
read again without closing/opening.

But indeed that's not sufficient for normal editors...

Hello
I did "ls -l " to see the attribution of the file .
$ ls -l
-rw-r--r-- 1 root root 4096 Feb 14 15:15 trigger
$ file trigger
trigger: ASCII text

But it gave me the normal file attribution by the 1st byte.
I want to know how this OS dealing this.

Best.

Roka