|
|
发表于 2006-5-31 13:04:37
|
显示全部楼层
为什么?会出问题。目录间的循环。。
Linux中存在特殊的对目录的硬链接,"."和".."就是对目录自身和上层目录的硬链接。
在某些Unix系统中,root是可以对目录进行硬链接的。
POSIX 1003.1对此的解释:
RATIONALE
Linking to a directory is restricted to the superuser in most historical implementations because this capability may produce loops in the file hierarchy or otherwise corrupt the file system. This volume of IEEE Std 1003.1-2001 continues that philosophy by prohibiting link() and unlink() from doing this. Other functions could do it if the implementor designed such an extension.
Some historical implementations allow linking of files on different file systems. Wording was added to explicitly allow this optional behavior.
The exception for cross-file system links is intended to apply only to links that are programmatically indistinguishable from "hard" links. |
|