Q&A: Text file lockout

Q Sporadically, when I go to edit a text file that I have earlier changed and saved, the app refuses. I have checked permissions, and have read and write access. How is it getting locked?

A There are several ways that files can become locked like this. If you do not have read and write access, as shown in the Finder’s Get Info dialog, then OS X will refuse you. Some apps may save a file by removing the old version and writing a new one, so you also need read and write access to the folder storing the document.

Get Info will show not only permissions, but also whether a file is locked. Either can prevent you from changing and saving it.
Get Info will show not only permissions, but also whether a file is locked. Either can prevent you from changing and saving it.

It is generally safest to confine editing to files stored in the Documents and similar folders in your Home folder, where you have those permissions.

There is also a Lock flag, shown and changed in the upper part of the Get Info dialog, which prevents changes to a file even when your permissions are OK.

Apps can additionally lock a file open if they wish to do so, and sometimes bugs and other problems such as unexpected quitting can leave a file locked open. Finally, some older apps do not work properly with the new Save/Rename commands, and need to be updated.

Updated from the original, which was first published in MacUser volume 30 issue 09, 2014.