在Win12和Win2008中重命名文件的基础体系结构的差异
只想知道在不同版本的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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您只关心重命名,请只忽略任何不是
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 saysIt 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.