News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Getting Folder LastAccess Date

Started by ChillyWilly, February 14, 2010, 07:24:30 PM

Previous topic - Next topic

sinsi

Any reason for using CreateFile instead of FindFirstFile?
Light travels faster than sound, that's why some people seem bright until you hear them.

donkey

Quote from: sinsi on February 15, 2010, 01:11:02 AM
Any reason for using CreateFile instead of FindFirstFile?

Either work  just as effectively, in this case it really makes no difference. I just used CreateFile because Chilly Willy did.

ftime FILETIME <?>
stLocal SYSTEMTIME <?>
szFileTime TCHAR 256 DUP (?)
wfd WIN32_FIND_DATA <?>


invoke FindFirstFile,"D:\MyFolder",OFFSET wfd
invoke FindClose,eax

invoke FileTimeToLocalFileTime,offset wfd.ftLastWriteTime ,offset ftime
invoke FileTimeToSystemTime,offset ftime ,offset stLocal
invoke GetDateFormat,LOCALE_SYSTEM_DEFAULT,NULL, OFFSET stLocal,"'Last Modified:' MMM dd, yyyy ",OFFSET szFileTime,64
push edi
mov edi,OFFSET szFileTime
mov ecx,256
xor eax,eax
repne scasw
dec edi
dec edi
invoke GetTimeFormat,LOCALE_SYSTEM_DEFAULT,NULL,OFFSET stLocal,"'@' h:mm tt",edi,64
pop edi


"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

oex

QuoteNote:  In rare cases, file information on NTFS file systems may not be current at the time you call this function. To be assured of getting the current file information, call the GetFileInformationByHandle function.

http://msdn.microsoft.com/en-us/library/aa364418(VS.85).aspx

I think this applies.... fyi
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv