File Creation Date
Posted: Sun Oct 02, 2011 7:02 pm
Hi everyone,
Anyone knows how to extract a file creation date? Kindly assist me.
Anyone knows how to extract a file creation date? Kindly assist me.
Exclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
http://mail.hmgforum.com/
Have you tried the function FileStats() from harbour contrib library xHbkarweru wrote:Thanks Walter. The function however seems to return the date the file was last changed, not created.
Code: Select all
PROCEDURE ShowStats( cFile )
LOCAL cAttrib, nSize, dCDate, nCTime, dMDate, nMTime
LOCAL cColor
IF FileStats( cFile, @cAttrib, @nSize, @dCDate, @nCTime, @dMDate, @nMTime )
@10,2 SAY "File name: " + cFile
@11,2 SAY "Attributes: '" + cAttrib + "'"
@12,2 SAY "File size: " + Alltrim( Str( nSize ) )
@13,2 SAY "Created: " + DtoC( dCDate ) + " " + TimeOfDay( nCTime )
@14,2 SAY "Modified: " + DtoC( dMDate ) + " " + TimeOfDay( nMTime )
ELSE
cColor = SetColor( "r+/b" )
@10,2 SAY "NOT FOUND: " + cFile
SetColor( cColor )
ENDIF
RETURN