0

I am on OSX Mojave and I have a file with the following permissions:

-rw-r--r-- 1 root wheel 2.7K Jan 31 04:32 settings.json

I did a sudo su - and now whoami returns root.

Any idea why I still can't save any change I make to this file? When I try to :w in vim I get "settings.json" E212: Can't open file for writing.

  • My first thought is either SIP or TCC, two systems which have the power to "override" root. The former can be fully disabled. What is this file? Is it a system file or a file you created? – Wowfunhappy Jan 31 at 22:53
  • What is the output of: ls -le@ /path/to/settings.json – user3439894 Jan 31 at 23:08
  • -rw-r--r-- 1 root wheel 2755 Feb 1 08:25 settings.json – daniels Feb 1 at 6:27
  • 1
    @daniels please post the output of ls -lhoOd /path/to/settings.json – Igor Voltaic Feb 1 at 10:03
  • 1
    @daniels and the output of lsof +D /path/to/settings.json as well – Igor Voltaic Feb 1 at 10:49
1

Like you said in a comment , it's a file in Bitdefender antivirus's folder, so there is a chance that the software is blocking anybody to access writing the file.

Have you tried to stop Bitdefender to unlock the file ?

Otherwise, if you try to copy the file, then modify it and put it back in the folder, did it works ?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .