Windows有像Linux一样的Inode数字吗? [英] Does Windows have Inode Numbers like Linux?

查看:289
本文介绍了Windows有像Linux一样的Inode数字吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows有像Linux一样的Inode数字吗? Windows如何在内部管理文件?

解决方案

使用的术语与您在Unix世界中找到的有所不同,然而就具有唯一标识一个文件的整数而言,NTFS和一些Windows API暴露了类似的文件ID的概念。

您可以查询文件经由 开放手柄的ID GetFileInformationByHandle 。参见 nFileIndexHigh nFileIndexLow ;这是64位的文件ID的高和低部分。

NtCreateFile 也可以通过它的ID打开一个文件。请参阅 FILE_OPEN_BY_FILE_ID 标志。您需要通过文件ID打开卷处理。


Does Windows have Inode Numbers like Linux? How does Windows internally manage files?

解决方案

The terminology used is a bit different from what you'd find in the Unix world, however in terms of having an integer that uniquely identifies a file, NTFS and some Windows API expose the concept of "file IDs" which is similar.

You can query the file ID of an open handle via GetFileInformationByHandle. See nFileIndexHigh, nFileIndexLow; this is the high and low parts respectively of the file ID which is 64 bits.

NtCreateFile can also open a file by its ID. See the FILE_OPEN_BY_FILE_ID flag. You need a volume handle to open by file ID.

这篇关于Windows有像Linux一样的Inode数字吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆