Since you haven't used ls -le
as recommended, we don't know what the access control list looks like, but there might be something going on there that is preventing you from being able to write the files. The fact that a newly created user CAN edit the files makes me even more suspicious.
This command will remove ALL access control list entries from the folder and all its subfolders and files:
sudo chmod -RN path/to/folder/containing/files
Once you've cleared the access control list, try resetting the ownership like so:
sudo chown -R ulrikdamn:staff path/to/folder/containing/files
Now grant permissions like so:
sudo chmod -R u+rwX,g+rX,o+rX path/to/folder/containing/files
This gives you full read/write permissions. The "staff" group and all other users get full read permissions. Using an uppercase X, sets the execute bit for all directories within the tree, but leaves the execute bit for regular files as is.
Lowercase x would set the execute bit for all folders AND files. The execute bit must be set for a directory in order to read its contents. If you'd like to give write permissions to the group or others, switch out for g+rwX
or o+rwX
as necessary in the last command.
Here I'm passing in a folder path. If you want to pass in a single file, just remove the -R
from each command. The R makes the command recursive, applying it to an entire directory tree. Without it, the command will modify the permissions for a single file or folder passed in.
Permissions repair only affects folders and packages installed by apple and during software updates and it leaves most user folders alone.
You should be able to run it again to fix anything not correct. If there are still issues, you likely have a user definition corruption issue and might have to attack that head on. Which specific app it folder has these issues? Edit your question and this can also be edited once more detail is provided.
Best Answer
Right click on the Desktop icon in finder, show info. Is the the folder selected as 'Locked' for some reason (little padlock bottom left corner of icon in Info window)?
Expand the 'Sharing and Permissions' section, should say 'custom access' and the privilege should show Read & Write.
Click the little padlock bottom right of Info window, enter admin details and click the little cog, and select 'Apply to closed items'.
Could also open Disk Utility, select the drive, click 'First Aid' and check the volume for errors. This last may not have any effect, and should come back showing as all good. The 'Repair disk permissions' will be completed automatically whenever you run any software updates and does not require you to do it manually any more.