简体   繁体   English

Mac OSX上的权限

[英]Permissions on Mac OSX

I think that this is a permissions issue but I am not sure and I am not sure how to repair the problem. 我认为这是一个权限问题,但是我不确定,也不确定如何解决该问题。

I have a new MacBook. 我有一台新的MacBook。 I have 2 external drives that were previously used on another MacBook. 我有2个以前在另一台MacBook上使用过的外部驱动器。 I have a lot of folders and XCode projects on the external drives. 我在外部驱动器上有很多文件夹和XCode项目。 When I try to work on the projects, there is a message similar to this: 当我尝试处理项目时,会出现类似以下消息:

"This file is not writable. You may not be able to save your changes, but you will be able to Save a Copy somewhere else. Do you want to edit this file anyway?" “此文件不可写。您可能无法保存所做的更改,但将能够在其他位置保存副本。是否仍要编辑此文件?”

If I make changes and try to close the project I get this error: 如果我进行更改并尝试关闭项目,则会出现此错误:

"The project and user files project.pbxproj and macbook.pbxuser for project “thirdtry.xcodeproj” are not writeable and cannot be saved. Your changes will be lost if you close the project. You may need to SCM edit these files to gain writability." “项目“ thirdtry.xcodeproj”的项目和用户文件project.pbxproj和macbook.pbxuser不可写,也无法保存。如果关闭项目,更改将丢失。您可能需要SCM编辑这些文件以获得可写性”。

I have tried just to rename the folder but that permission is not allowed either unless I individually change permissions for every file in an XCode project. 我只是尝试重命名文件夹,但不允许该权限,除非我单独更改XCode项目中每个文件的权限。 As you can imagine, this could be time consuming for tons of files and projects. 您可以想象,这可能会耗费大量文件和项目。

I can copy the project into internal memory and can run it then after renaming the folder that contains all of the files. 我可以将项目复制到内部存储器中,然后在重命名包含所有文件的文件夹后可以运行它。 This defeats the purpose of having all of the projects on an external drive. 这违反了将所有项目都放在外部驱动器上的目的。

Also, in XCode, there is no "Build and Run" there is only "Build and Debug" now. 另外,在XCode中,现在没有“ Build and Run”,只有“ Build and Debug”。 I don't know if this is related or not. 我不知道这是否相关。

Suggestions for how to repair all permissions to all files and folders on my external drives? 有关如何修复外部驱动器上所有文件和文件夹的所有权限的建议? What about the "Build and Debug" and no "Build and Run" choice? 那么“构建和调试”又没有“构建并运行”的选择呢?

Thanks, Linda 谢谢琳达

You can Get Info on the external drive in the Finder and check "Ignore ownership on this volume". 您可以在Finder中获取有关外部驱动器的信息 ,然后选中“忽略该卷的所有权”。 This will let you continue to use the drive on your other computer as before. 这样,您就可以像以前一样继续使用另一台计算机上的驱动器。 If you no longer use the old machine, Paul's answer is a better solution. 如果您不再使用旧机器,Paul的答案是一个更好的解决方案。

The files and folders on the external drives probably have the wrong owner . 外部驱动器上的文件和文件夹可能具有错误的所有者 You can easily rectify this via the command line using chown , eg 您可以使用chown通过命令行轻松纠正此问题,例如

$ sudo chown -R myusername /Volumes/ExternalVolume/MyProjects/*

For documentation see: 有关文档,请参见:

$ man chown $男子chown

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM