EACCES: permission denied in VS Code MAC

前端 未结 11 801
我寻月下人不归
我寻月下人不归 2021-01-31 02:20

When I change any file, the system will deny me access. What\'s going on? How do I properly set permissions on Mac?

11条回答
  •  误落风尘
    2021-01-31 02:24

    First, take note of the current permissions of all files and folders by issuing the command:

    ls -lR  > old_permissions.txt
    

    which will save the output of the command ls -l to the file old_permissions.txt in the current directory.

    If you have no idea of how permissions work and what the results of the previous command represent, please, have a look at https://ss64.com/bash/syntax-permissions.html and https://ss64.com/bash/chmod.html.

    At this point, to modify any of the files under , you can give full permission to all subfolders and files recursively by issuing the command:

    sudo chmod -R 777 
    

    Note that you're responsible for the changes your perform!

    After having saved the updates, you can reset the previous permission settings of the folders by looking at the old permissions saved in the file old_permissions.txt. You should set the permissions manually (unless you create e.g. a script to do it automatically using the info saved in old_permissions.txt).

    Note: it's probably a better idea to only modify the permissions of the specific files that you want to modify (and not of the whole folder).

提交回复
热议问题