def var ca_file1 as char format "x(60)".
def var ca_file2 as char format "x(60)".
ca_file1 = "/somedir/somefile.txt".
file-info:file-name = ca_file1.
ca_file2 = string(file-info:file-create-date).
display ca_file2.
input through value( "ls -l " + "/somedir/somefile.txt").
import unformatted ca_file.
ca_file1 = substring(ca_file,46,35).
input close.
doreynie,
on hpux your suggestion only returns a '?'
DEFINE VARIABLE fi AS CHARACTER NO-UNDO.
INPUT THROUGH VALUE('ls -l test.p').
/* fi keeps all information about test.p file */
IMPORT UNFORMATTED fi.
INPUT CLOSE.
Looks like the file-create-date and file-create-time function is supported on windows only. On HPUX you should be able to use the file-mod-date and file-mod-time.
NB : one should have the right permissions on the file-system to access the data you want to retrieve. See documentation about the file-info handle.
FILE-INFO:FILE-NAME = "<your file>".
MESSAGE "<name>" ENTRY(1,PROGRAM-NAME(1)," ") SKIP
FILE-INFO:FILE-CREATE-DATE SKIP
STRING(FILE-INFO:FILE-CREATE-TIME,"HH:MM:SS") SKIP
FILE-INFO:FILE-MOD-DATE SKIP
STRING(FILE-INFO:FILE-MOD-TIME,"HH:MM:SS")
VIEW-AS ALERT-BOX INFO BUTTONS OK TITLE "DEBUG".