Directory creation date

5 views
Skip to first unread message

Cassius

unread,
Jul 1, 2008, 3:22:14 AM7/1/08
to
Hi!
I'm trying to read a date of directory creation:

LPCTSTR kat="d:\\!\\";
GET_FILEEX_INFO_LEVELS info1=GetFileExInfoStandard;
_WIN32_FILE_ATTRIBUTE_DATA *info3;
GetFileAttributesEx(kat, info1, info3);
ULONGLONG qwResult;
qwResult = (((ULONGLONG)info3->ftCreationTime .dwHighDateTime) << 32)
+ info3->ftCreationTime.dwLowDateTime;
Label1->Caption=FileDateToDateTime(qwResult).DateTimeString();

I made some mistake -> the date is incorrect and additional when I'm
closing the program windows shows Run-Time error :/ :( Maybe there is
some more flexible method of checking directory creation date? I tried
to use FileAge('DIR'); but it doesn't work with dirs :(
I will be very grateful for hints.
BRs
A.B.

Cassius

unread,
Jul 1, 2008, 3:47:19 AM7/1/08
to

Hi!
I foun solution:

LPCTSTR kat="d:\\!\\";
GET_FILEEX_INFO_LEVELS info1=GetFileExInfoStandard;
_WIN32_FILE_ATTRIBUTE_DATA *info3;
GetFileAttributesEx(kat, info1, info3);

FILETIME ft=info3->ftCreationTime;
SYSTEMTIME st;
FileTimeToSystemTime(&ft, &st);
TDateTime a=SystemTimeToDateTime(st);
Label1->Caption=a.DateTimeString();

But still I have problem with Run Time error :(

"Run time error 204 at 326071B4"
BRs,
A.B.

Reply all
Reply to author
Forward
0 new messages