Handmade Hero»Forums»Code
Chris
21 posts
Last file write time with GetFileAttributesEx
Please pardon the noise if this question was already answered.

Did Casey mention why he didn't use GetFileAttributesEx to get the last write time of the game DLL? The API returns a structure, WIN32_FILE_ATTRIBUTE_DATA, that's got that timestamp as one of its fields. The calls to FindFirstFile and FindClose could be skipped and you wouldn't have to manage an OS handle.

Thanks,

-Chris
Casey Muratori
801 posts / 1 project
Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.
Last file write time with GetFileAttributesEx
We looked quickly at doing it without a handle and couldn't find it so we used FindFirst/FindNext. GetFileAttributesEx is what I wanted! I will update it when we do cleanup.

- Casey
Chris
21 posts
Last file write time with GetFileAttributesEx
Oh cool! Happy that helps.