在Win12和Win2008中重命名文件的基础体系结构的差异

发布于 2025-01-18 20:50:29 字数 165 浏览 3 评论 0原文

只想知道在不同版本的Windows中重命名文件的基础架构是什么。

我正在使用ReadDirectoryChanges(),并且在Windows2012和Windows 2016中获取File_Rename,而我正在获得File_Rename和File_Modified for Windows2008。

Just want to know what is the badic underlying architecture of renaming a file in different versions of Windows.

I am using ReadDirectoryChanges() and am getting a FILE_RENAME in buffer for Windows2012 and Windows 2016 while I am getting a FILE_RENAME and FILE_MODIFIED for Windows2008.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

银河中√捞星星 2025-01-25 20:50:29

如果您只关心重命名,请只忽略任何不是file_action_renamed _*的东西。

我不知道是否有任何架构更改,即使存在,它也不会对您产生影响。

您是否仅通过file_notify_change_file_name或其他标志?

对于file_action_modified msdn说

文件已修改。这可能是时间戳或属性的变化。

这可能只是最后一次更新的访问时间。 NTFS最后一次访问时间更新通常会以新的Windows版本关闭,以减少磁盘I/O。 fsutil.exe可以告诉您它是否打开或关闭。

If you only care about renames, simply ignore anything that is not FILE_ACTION_RENAMED_*.

I don't know if there are any architectural changes and even if there are, it should be of no consequence to you since you should be coding to the documented API, not whatever low-level things that goes on in the I/O manager.

Are you passing just FILE_NOTIFY_CHANGE_FILE_NAME or other flags?

For FILE_ACTION_MODIFIED MSDN says

The file was modified. This can be a change in the time stamp or attributes.

It could simply be the last access time getting updated. NTFS last access time updates are usually turned off in newer versions of Windows to reduce disk I/O. fsutil.exe can tell you if it is on or off.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文