macos 符号链接和别名在 OS X 上是一回事吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6311568/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Are symbolic links and aliases the same thing on OS X?
提问by
I have been trying to set up some symbolic links in the Terminal, and haven't been able to get them to work.
我一直在尝试在终端中设置一些符号链接,但一直无法让它们工作。
In trying to find what I was doing wrong, I compared their function to the "create alias" button in the right click menu.
为了找出我做错了什么,我将它们的功能与右键单击菜单中的“创建别名”按钮进行了比较。
My question is this: what is the difference between alias(es) and symbolic links in Mac OS X?
我的问题是:Mac OS X 中的别名和符号链接有什么区别?
采纳答案by bot47
While symbolic links are a feature of the file system, aliases are a feature of OS X. I don't know if they still use that technique, but back in the days of Mac OS Classic or even System 7, they were a file with just a resource fork which had a special resource telling the OS what path AND what file-id the file had.
虽然符号链接是文件系统的一个特性,但别名是 OS X 的一个特性。我不知道他们是否仍然使用这种技术,但在 Mac OS Classic 甚至 System 7 的时代,它们是一个文件只是一个资源分支,它有一个特殊的资源,告诉操作系统文件的路径和文件 ID。
Symbolic links are more like a database entry on file system level. They differ from hard links in the point that they get invalid when you delete or move the target file. Hard links are actual file entries in the file systems catalog pointing to the same location on your storage medium.
符号链接更像是文件系统级别的数据库条目。它们与硬链接的不同之处在于,当您删除或移动目标文件时,它们会变得无效。硬链接是文件系统目录中指向存储介质上相同位置的实际文件条目。