How do you delete a corrupted prefs file in Mojave?
With a vast and previously unnecessary amount of difficulty.
This is when security combined with nannying the user becomes abusive.
- You cannot find the file using Spotlight
- You cannot rename it
- You cannot change permissions
- You cannot drag it to the Trash
- You cannot replace it
- You cannot compress it
- You cannot delete it using Secure Delete in Cocktail or Onyx
- You cannot even delete it when started up in Target Disk Mode on another computer
- You cannot delete it using Terminal in the standard manner
- It is not visible in Time Machine
What do you do? Apple say nothing on the subject.
First of all you should make the hidden Library folder visible.
Find the corrupt file using Find Any File, not Spotlight.
It was identified in this case because of a bad creation date.
Then I used the dangerous rm -f function in Terminal. When I dragged the recalcitrant file dated 1 January 1970 into the Terminal window it gave the name Library/Preferences/com.apple.ResourceFork, which was wrong. Naturally the reply from Terminal was No such file or directory. This was an OS error, perhaps related to APFS.
Only when I manually typed in the actual file name Library/Preferences/com.phaseone.mediapro.settings did Terminal finally manage to delete the file, and I got back to normal working. Many hours wasted.