检测符号链接,交接点,安装点和硬链接交接点、链接、符号

由网友(小饼干)分享简介:没有人知道如何检查,如果一个文件或目录可以是一个符号链接 结点 挂载点或硬链接 does anyone know how to check if a file or directory is either a Symbolic Link, Junction Point, Mount Point or Hard Lin...

没有人知道如何检查,如果一个文件或目录可以是一个符号链接 结点 挂载点或硬链接

does anyone know how to check if a file or directory is either a Symbolic Link, Junction Point, Mount Point or Hard Link?

据我知道一个符号链接是通过检查它的ReparsePoint属性的文件进行检测。 结点通过检查ReparsePoint属性的目录检测。因此,如果ReparsePoint属性被设置在一个文件时,它必须是一个符号链接,否则,如果它在一个目录设置它只能是一个结点,对吧?

As far as I know a symbolic links are detected by checking a file for its "ReparsePoint" attribute. Junction points are detected by checking a directory for the "ReparsePoint" attribute. So if the "ReparsePoint" attribute is set on a file it must be a symbolic link, otherwise if it's set on a directory it can only be a junction point...right?

好为止,但我还是不知道如何检测挂载点和硬链接。 谁能告诉我如何做到这一点?

Good so far, but I have still no idea how to detect "Mount Points" and "Hard Links". Can anyone tell me how to do this?

推荐答案

符号链接,交接点,并挂载点是不同的重分析点的例子。硬链接,然而,仅仅是普通文件。在NTFS中的所有文件都是硬链接。您可以检测到一个文件有多个硬链接指向它,但没有真正的文件,它指向。你可以把硬连接的只是不同的名称相同的文件。

Symbolic Links, Junction Points, and Mount Points are all examples of different reparse points. Hard Links, however, are just regular files. On NTFS all files are hard links. You can detect that a file has multiple hard links pointing to it, but there's no "real file" that it points to. You can think of hard links as just different names for the same file.

下面是从C#访问重解析点的一些信息:http://www.$c$cproject.com/KB/vista/ReparsePointID.aspx?display=Print

Here's some information on accessing reparse points from C#: http://www.codeproject.com/KB/vista/ReparsePointID.aspx?display=Print

下面是关于如何做到这一点在C中的一些信息: http://blog.kalmbach-software.de/2008 / 02 /

Here's some information on how to do it in C: http://blog.kalmbach-software.de/2008/02/

阅读全文

相关推荐

最新文章