How to access file information?

Hello all,

I want to retreive the files from directory and access the modified date of the file. Iam able to retreive the file names from specific directory but not able to get their information like modified date of the file.

Please suggest me what to do in order to retreive the modified date of the file.

Thanks & Regards
Prasad
 

Casper

ProgressTalk.com Moderator
Staff member
Like this?

Code:
DEFINE VARIABLE cDir AS CHARACTER   NO-UNDO.
DEFINE VARIABLE cFile AS CHARACTER   NO-UNDO.
 
DEFINE STREAM sIn.
 
ASSIGN cDir= 'c:\temp\test'.
 
INPUT STREAM sIn FROM OS-DIR(cDir) NO-ATTR-LIST.
REPEAT :
 
    IMPORT STREAM sIn cFile.
    IF cFile = '.' OR 
       cFile = '..'
    THEN NEXT.
    ASSIGN FILE-INFO:FILE-NAME = cDir + '\' + cFile.
    DISPLAY FILE-INFO:FULL-PATHNAME FORMAT 'X(40)' FILE-INFO:FILE-MOD-DATE.
END.
 
INPUT STREAM sIn CLOSE.

Regards,

Casper.
 
Top