Day 22 -How to get file write time without handles

To get last file write time without any handles (FindFirstFile / CreateFile+GetFileTime) you can use GetFileAttributesEx function like this:

1
2
3
4
5
WIN32_FILE_ATTRIBUTE_DATA FileAttributes;
if (GetFileAttributesExA("handmade.dll", GetFileExInfoStandard, &FileAttributes))
{
    LastWriteTime = FileAttributes.ftLastWriteTime;
}


No need to close anything afterwards!

Edited by Mārtiņš Možeiko on