I’m wondering–what is the best way to prevent a file (say, a custom CSS file associated with a plugin) from being overwritten during the update process?
Would setting the file’s status as immutable do the trick, or would this just cause an error during update? What is the best way to go about doing this?
Basically you should not include the file in the plugin in the first place. If the reason you don’t want it to be overwritten is because you modify it based on some local setting, then you should leave the immutable part of the file in it and create another file which will contain the mutable parts.
Then you can use your CSS like that (assuming you suplly constant.css with the plugin and generate costum.css locally.