WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Making immutable attribute persistent  (Read 14 times)

Offline Leee

  • Wiki Author
  • Full Member
  • *****
  • Posts: 213
Making immutable attribute persistent
« on: May 19, 2026, 11:06:12 PM »
I'm using Core 17.0 on x86_64

Is there a handy way to get the "immutable" attribute of a file to persist across a backup and restore cycle?

My issue is this:  I have an application (emelfm2) that insists on changing the value of a certain setting in its config file to its default value when the program is closed and restarted.

Alarmingly, it does this even when the config file's ownership is changed to root:root and all write permissions are removed and the application is -not- running as root..

Using chattr to set the immutable attribute solves the problem,  but doesn't survive a reboot with backup and restore because the file is restored without "immutable" set..
As one-off, I could put a line in bootsync.sh to set the immutable attribute, but that feels clumsy so I'm looking for a more elegant solution.
  • use persistent HOME, which I don't want to do
  • remaster the emelfm2 extension to include the config file on r/o media (which would prevent me from ever changing any other setting)
  • use a different file manager, which I don't want to do
but none of those really seem ideal either.

The file in question is ~/.config/emelfm2/config-C.

The setting within the file has to do with the way file dates are displayed.  There is a drop down list to select any of several preconfigured date formats (all of which are stupid) or "strftime() format provided below" with a box to enter a custom time format.  When the setting resets to default, it doesn't lose the custom format, it just forgets that its supposed to actually use it.

I think emelfm2 is an abandoned application so, while it would be ideal to have the application fixed, I don't think that's going to happen.  I'm comfortable with making the config file immutable and, if I have to, I'll reinstate the immutability at boot time but I'm hoping someone will mention something I've missed that allows the immutable attribute to be saved.  Feel free to say, "Well, dumbhead, did you try ...."


Any ideas?
core 16.0 x86_64

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12764
Re: Making immutable attribute persistent
« Reply #1 on: Today at 12:38:29 AM »
Hi Leee
... The file in question is ~/.config/emelfm2/config-C. ...
I just tried it under TC14 x86_64.
I selected strftime() and set the custom format to %Y%m%d.
Then I hit Apply and then Commit.
I closed emelfm2 and then opened it. The config file retained the custom format.
I then closed emelfm2 again. The config file reverted to "Default".

The config file also contains this note:
Quote
# emelFM2 (v 0.9.1)

# This is the emelFM2 configuration data file.
# It will be overwritten each time the program is run!