How can a file's contents change but the file's attibutes remain the same?
Posted: 2022-01-25 19:44
I'm trying to write a system monitor for my desktop (no, I don't want to use something else), but I've come across a problem I can't understand.
I open the file `/sys/class/power_supply/BAT0/uevent` and notice all the fields. Close it and open it again and notice the field `POWER_SUPPLY_TEMP` value has changed from `315` to `318`. But when I do `ls /sys/class/power_supply/BAT0/uevent` it lists the modified date as the day I booted my system up (2 days prior).
How can the information in the file be updated but not have the attributes updated?
Also, why `inotify` isn't informed of a change to the file?
I open the file `/sys/class/power_supply/BAT0/uevent` and notice all the fields. Close it and open it again and notice the field `POWER_SUPPLY_TEMP` value has changed from `315` to `318`. But when I do `ls /sys/class/power_supply/BAT0/uevent` it lists the modified date as the day I booted my system up (2 days prior).
How can the information in the file be updated but not have the attributes updated?
Also, why `inotify` isn't informed of a change to the file?