For getting the file date(s) I wrote the following class in VB.NET (using VisualStudio), made a DLL of it and imported it using Tools>.NET DLL Importer in PowerBuilder 2019 R2:
"Imports System.IO 'File Class
Public Class CHilfsfunktionen
Public Shared Function FileVersion(ByVal Path As String) As String(,)
FileVersion = Nothing
Dim fi As FileInfo = Nothing
If Not File.Exists(Path) Then Return Nothing
Try
fi = New FileInfo(Path)
FileVersion = {{"Directory", fi.Directory.FullName},
{"Full Name", fi.FullName},
{"Name", fi.Name},
{"Creation Time", fi.CreationTime.ToString},
{"Last Write Time", fi.LastWriteTime.ToString},
{"Last Access Time", fi.LastAccessTime.ToString}
}
Catch ex As Exception
FileVersion = {{"Exception", ex.Message}}
End Try
End Function
End Class".
In my PowerScript script I could access the file dates afterwards the following way:
Application gnv_thisApp
string gs_ThisAppPath
string lsm_exe[]
nvo_chilfsfunktionen nvo_help
gnv_thisApp = GetApplication ()
gs_ThisAppPath = getcurrentdirectory () + "\" + gnv_thisApp.appname
nvo_help = Create nvo_chilfsfunktionen
lsm_exe = nvo_help.of_fileversion( gs_thisAppPath + ".exe" )
messagebox("", lsm_exe[4] + ": " + lsm_exe[10] + "~n" + &
lsm_exe[5] + ": " + lsm_exe[11] + "~n" + &
lsm_exe[6] + ": " + lsm_exe[12])
I'm not sure if that also allows you to get the file date, but if not (and using the pfc classes), you can have a look at the "pfc_n_cst_filesrvunicode" or use another very useful object provided on Roland's website: "n_filesys": https://www.topwizprogramming.com/freecode_filesys.html
regards
thank you for the hints! Indeed I didn't get the file date using n_osversion. But I managed it writing a class in VB.NET with with an apropriate method, see below. The pfc classes I am not knowing yet.
Regards,
Konrad
regards