NTFS如何区分文件夹和文件
我知道如果 1 存在于属性的二进制表示的第四个位置,那么这是一个目录,但我不确定 1 是否不存在于该位置,我是否应该将其视为文件?
或者是否存在任何其他属性来确定文件夹或文件? 请帮我。
谢谢。
i know that if 1 is present at the 4th position of binary representation of attribute then this is a directory, but i am not sure if 1 is not present at that location should i consider it as a file?
or is there any other attribute present to determine folder or file ?
please help me.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每个文件在卷的主文件表 (MFT) 中都有一个文件记录。
您可以检查存储在 0x16 和 0x17 处的 2 字节标志(注意,小尾数)。第二位(从右数)告诉它是文件夹(1)还是文件(0)。
如果您将最初代表文件的该位强制更改为 1(例如在 WinHex 的帮助下),并且(可能需要重新启动或需要刷新系统缓存)双击它,操作系统将报告文件已损坏。
另外,第一位表明它是否被删除。
Every file has a File Record in Master File Table (MFT) of the volume.
You can check the 2-byte flag stored at 0x16 and 0x17(attention, little endian). The second bit (counting from right) tells whether it's a folder(1), or a file(0).
If you change this bit that would originally represent a file to 1 by force, for example with the help of WinHex, and (probably a restart or system cache fresh is needed) double click it, OS would report that the file is corrupted.
In addition, the first bit tells if it is deleted.