File Creation Date

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
karweru
Posts: 220
Joined: Fri Aug 01, 2008 1:51 pm
DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
Contact:

File Creation Date

Post by karweru »

Hi everyone,

Anyone knows how to extract a file creation date? Kindly assist me.
Kind regards,
Gilbert.
User avatar
tave2009
Posts: 61
Joined: Tue Jul 14, 2009 3:33 am
Location: San Francisco, Córdoba, Argentina.

Re: File Creation Date

Post by tave2009 »

Hello Kaweru:
This exists in Harbour and is:

? FILEDATE("C:\TEXT\TEXT.TXT") // The date

Show the date of a particular file. :lol:
Hope this helps.

Saludos
Walter
Nada se pierde. Todo se transforma. (Lavoussier)
Nothing is lost. Everything changes.
User avatar
karweru
Posts: 220
Joined: Fri Aug 01, 2008 1:51 pm
DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
Contact:

Re: File Creation Date

Post by karweru »

Thanks Walter. The function however seems to return the date the file was last changed, not created.
Kind regards,
Gilbert.
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: File Creation Date

Post by Rathinagiri »

I think we have to use Win32 API function calls for this.

http://support.microsoft.com/kb/188977

This article (for FoxPro) may help.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
gfilatov
Posts: 1116
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: File Creation Date

Post by gfilatov »

karweru wrote:Thanks Walter. The function however seems to return the date the file was last changed, not created.
Have you tried the function FileStats() from harbour contrib library xHb :?:

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
Hope that helps :idea:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: File Creation Date

Post by Rathinagiri »

Thanks Grigory. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
karweru
Posts: 220
Joined: Fri Aug 01, 2008 1:51 pm
DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
Contact:

Re: File Creation Date

Post by karweru »

Thank you so much Grigory.
Kind regards,
Gilbert.
User avatar
danielmaximiliano
Posts: 2763
Joined: Fri Apr 09, 2010 4:53 pm
DBs Used: DBF
Location: Argentina
Contact:

Re: File Creation Date

Post by danielmaximiliano »

"Ohh, quien podra salvarme"

Yoooo el chapulin colorado!!!

Grigory, gracias por el dato, siempre contamos con su ayuda.


Translata Google:

"Ohh, who can be saved"

I´the chapulin colorado!!!

Grigory, thanks for the tip, always have your help.
Attachments
Chapulin+Colorado[1].jpg
Chapulin+Colorado[1].jpg (14.96 KiB) Viewed 4960 times
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Telegram invitation https://t.me/HMGWorkspace
Post Reply