FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour NNETFILES() creation time of a file
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
NNETFILES() creation time of a file
Posted: Fri Jun 15, 2018 03:37 PM

Hello,
I would need to get the creation time of a file.
It seems the is a function NNETFILES() in harbour.
Can someone help me please to get this information with xHarbour.
I can’t find this function in xHarbour.
Thank you in advance
Otto

NNETFILES() returns an array with subarrays (two-dimensional array). Each subarray contains information about each directory entry that is found. The structure of the subarrays are described in the following table.
Table 23.5: NNETFILES() Subarray Structure
Position Metasymbol CTNNET.CH Definition
1 cName NF_NAME Directory name
2 nSize NF_SIZE File size
3 cUpdDate NF_UPDDATE Date of last update
4 cUpdTime NF_UPDTIME Time of last update
5 dCrDate NF_CREADATE Creation date
6 nAttr NF_ATTR File attributes
7 nExtAttr NF_EXTATTR Extended file attributes
8 cOwner NF_OWNER Owner

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: NNETFILES() creation time of a file
Posted: Fri Jun 15, 2018 05:42 PM
Try this:

Code (fw): Select all Collapse
FUNCTION MAIN()

    LOCAL dCreated

    ? FILESTATS( "TEST.PRG", , , @dCreated ), dCreated

    RETURN NIL


EMG
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Re: NNETFILES() creation time of a file
Posted: Fri Jun 15, 2018 07:19 PM
Hello Enrico,
thank you for your help.
Something is not working as I aspect.
I am deleteing with Emagdbu.exe a record.
But FILESTATS() shows not the correct date of changing.
I use xHarbour.

"c:\xkm\T__058.dbf" dCreated = SToD("20180328") nCreateTime = 68501
"c:\xkm\T__058.dbf" dChangeDate = SToD("20180328") nChangeTime = 68501

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: NNETFILES() creation time of a file
Posted: Fri Jun 15, 2018 08:44 PM

Can we see a little PRG sample showing the problem, please?

EMG

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: NNETFILES() creation time of a file
Posted: Sat Jun 16, 2018 10:06 AM
This sample is working fine here:

Code (fw): Select all Collapse
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL cDbf := "MYTEST.DBF"

    LOCAL dDMod, nTMod

    DBCREATE( cDbf, { { "TEST", "C", 10, 0 } } )

    FILESTATS( cDbf, , , , , @dDMod, @nTMod )

    ? DTOS( dDMod ), TIMEOFDAY( nTMod )

    USE ( cDbf )

    APPEND BLANK

    REPLACE FIELD -> test WITH "TEST"

    CLOSE

    FILESTATS( cDbf, , , , , @dDMod, @nTMod )

    ? DTOS( dDMod ), TIMEOFDAY( nTMod )

    RETURN NIL


EMG

Continue the discussion