Board index » cppbuilder » A Quesdtion on File Creation Date

A Quesdtion on File Creation Date


2003-06-26 11:01:58 PM
cppbuilder18
I am trying to get the file creation date, however what I always get is the
Last Modified Date.
Here is some sample code that should give me the Creation date but doesn't"
if (OpenDialog->Execute()) {
// get the filename to check
txtDatabase->Text = OpenDialog->FileName;
// Used to get the file handle for FileGetDate()
int in;
// Open the file
in = FileOpen(OpenDialog->FileName, fmOpenRead);
// put the date into the Edit box - Get the file date
txtDate1->Text = FileDateToDateTime(FileGetDate(in));
FileClose(in);
// get the file date again using FileAge, use the FileDateToDateTime
function
// and get just the date string
txtDate2->Text =
DateToStr(FileDateToDateTime(FileAge(OpenDialog->FileName)));
//***********************************************************
}
again, all I ever get is the Modified File date, I need the creation date!
Can anyone help on this?
Thanks
Chuck
 
 

Re:A Quesdtion on File Creation Date

Depending upon the file system and operating system you might well get
exactly what you report. From your message I guess that you are using
Windows 98.
Win95, 98 and ME keep a limited set of information about file times and
dates. NT, Win 2000 and XP keep much more, especially if NTFS is being
used.
. Ed
Quote
C. W. Smith wrote in message
news: XXXX@XXXXX.COM ...

I am trying to get the file creation date, however what I always
get is the Last Modified Date.
 

Re:A Quesdtion on File Creation Date

No, I am using Windows 2000 Server, but either way, if the program is run on
95, 98, ME, XP or 2000 what do I use to get this information. If I have to
determine the operating system, then that is all right, I still need to get
the creation date of the file and I cannot find out how
"Ed Mulroy [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
Depending upon the file system and operating system you might well get
exactly what you report. From your message I guess that you are using
Windows 98.

Win95, 98 and ME keep a limited set of information about file times and
dates. NT, Win 2000 and XP keep much more, especially if NTFS is being
used.

. Ed

>C. W. Smith wrote in message
>news: XXXX@XXXXX.COM ...
>
>I am trying to get the file creation date, however what I always
>get is the Last Modified Date.


 

{smallsort}

Re:A Quesdtion on File Creation Date

"C. W. Smith" < XXXX@XXXXX.COM >wrote in message
Quote
No, I am using Windows 2000 Server, but either way,
if the program is run on 95, 98, ME, XP or 2000 what
do I use to get this information. If I have to determine
the operating system, then that is all right, I still need to
get the creation date of the file and I cannot find out how
Use GetFileTime() or FindFirstFile() from the Win32 API.
Gambit