Search code examples
dreamweaverxattrlocked-files

How to remove lock from file showing extended attributes


I am on macos mojave. I have a file on my system that was locked by Dreamweaver. I copied the file to another directory to work on it while it is checked out by another user, but the lock was copied with the file. So I have a file on my system outside the sandbox that I cannot write to and I cannot remove. Sudo is not helping. I noticed it has extended attributes and tried to clear it but it did not work. How can I clear the extended attribute or remove the file?

$ xattr index.html
com.apple.FinderInfo
$ xattr -c index.html
xattr: [Errno 1] Operation not permitted: 'index.html'
$ 

Solution

  • I found the problem. First I had to remove the lock. I did this through the Finder GUI.

    1. Control-click the file in your Finder.
    2. Select ‘Get Info’ from the menu that appears.
    3. Expand the ‘General’ section, if it isn’t expanded already.
    4. Deselect the ‘Locked’ checkbox.

    After the file was unlocked then the extended attribute could be removed.

    $ xattr index.html
    com.apple.FinderInfo
    $ xattr -c index.html
    $