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'
$
I found the problem. First I had to remove the lock. I did this through the Finder GUI.
After the file was unlocked then the extended attribute could be removed.
$ xattr index.html
com.apple.FinderInfo
$ xattr -c index.html
$