'Difference in underlying architecture for renaming a file in Win12 and Win2008

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.



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Anders