From fb7b5e9659df2dbc5457f23acbd848f13dd9d183 Mon Sep 17 00:00:00 2001 From: Mindaugas Kavaliauskas Date: Wed, 11 Feb 2009 17:28:45 +0000 Subject: [PATCH] 2009-02-11 19:30 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt) * harbour/include/hbextern.ch * harbour/source/rtl/philes.c + added HB_FGETDATETIME(). A "brother" of function HB_FGETDATETIME(). ; TODO: BTW, hb_fs*() functions can get a better precision (milliseconds). It would be nice to support it also at .prg level. --- harbour/ChangeLog | 7 +++++++ harbour/include/hbextern.ch | 1 + harbour/source/rtl/philes.c | 23 +++++++++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 786cf74ba4..76b4dae441 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,13 @@ 2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-02-11 19:30 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt) + * harbour/include/hbextern.ch + * harbour/source/rtl/philes.c + + added HB_FGETDATETIME(). A "brother" of function HB_FGETDATETIME(). + ; TODO: BTW, hb_fs*() functions can get a better precision + (milliseconds). It would be nice to support it also at .prg level. + 2009-02-11 18:30 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt) * harbour/source/vm/proc.c * hb_procname() support for symbol evaluation diff --git a/harbour/include/hbextern.ch b/harbour/include/hbextern.ch index 1d9fea639f..a3afee5f66 100644 --- a/harbour/include/hbextern.ch +++ b/harbour/include/hbextern.ch @@ -1153,6 +1153,7 @@ EXTERNAL HB_FCOPY EXTERNAL HB_FSETATTR EXTERNAL HB_FGETATTR EXTERNAL HB_FSETDATETIME +EXTERNAL HB_FGETDATETIME EXTERNAL HB_FILEEXISTS EXTERNAL HB_DIREXISTS EXTERNAL HB_FNAMEEXISTS diff --git a/harbour/source/rtl/philes.c b/harbour/source/rtl/philes.c index 8d36582053..38ed6fd9a1 100644 --- a/harbour/source/rtl/philes.c +++ b/harbour/source/rtl/philes.c @@ -402,6 +402,29 @@ HB_FUNC( HB_FSETDATETIME ) ISCHAR( 3 ) ? hb_timeStampEncode( iHour, iMinutes, iSeconds, 0 ) : -1 ) ); } +HB_FUNC( HB_FGETDATETIME ) +{ + LONG lJulian, lMillisec; + BOOL fRet; + + if( hb_fsGetFileTime( ( UCHAR * ) hb_parcx( 1 ), &lJulian, &lMillisec ) ) + { + char buf[ 13 ]; + + hb_stordl( lJulian, 2 ); + + hb_timeStampStr( buf, lMillisec ); + buf[ 8 ] = '\0'; + hb_storc( buf, 3 ); + + /* hb_stornl( lMillisec, 4 ); */ + + hb_retl( 1 ); + } + else + hb_retl( 0 ); +} + HB_FUNC( HB_OSERROR ) { hb_retni( hb_fsOsError() );