We use cookies to collect and analyze information on site performance and usage,
to provide social media features and to enhance and customize content and advertisements.
[structure]
type os_filedatetime from structure
unsignedlong ul_lowdatetime
unsignedlong ul_highdatetime
end type
type os_finddata from structure
unsignedlong ul_fileattributes
os_filedatetime str_creationtime
os_filedatetime str_lastaccesstime
os_filedatetime str_lastwritetime
unsignedlong ul_filesizehigh
unsignedlong ul_filesizelow
unsignedlong ul_reserved0
unsignedlong ul_reserved1
character ch_filename[260]
character ch_alternatefilename[14]
end type
type os_systemdatetime from structure
uint wYear
uint wMonth
uint wDayOfWeek
uint wDay
uint wHour
uint wMinute
uint wSecond
uint wMillisecond
end type
[external function declaration]
FUNCTION long FindFirstFileA &
( string filename, ref os_finddata findfiledata) &
LIBRARY "KERNEL32.DLL"
FUNCTION boolean FindClose (long handle) LIBRARY "KERNEL32.DLL"
FUNCTION boolean FileTimeToLocalFileTime &
( ref os_filedatetime lpFileTime, ref os_filedatetime lpLocalFileTime) &
LIBRARY "KERNEL32.DLL"
FUNCTION boolean FileTimeToSystemTime &
(ref os_filedatetime lpFileTime, ref os_systemdatetime lpSystemTime) &
LIBRARY "KERNEL32.DLL"
[powerscript]
os_FindData lstr_FindData
os_FindData lstr_FindDataTemp
os_SystemDatetime lstr_SystemDateTime
long handle
String ls_timestamp
handle=FindFirstFileA &
("C:\Program Files\Sybase\PowerBuilder 9.0\pb90.exe", lstr_FindData)
IF handle=-1 THEN
// something wrong!
ELSE
FindClose(handle)
FileTimeToLocalFileTime &
(lstr_FindData.str_lastwritetime, lstr_FindDataTemp.str_lastwritetime)
IF FileTimeToSystemTime &
(lstr_FindDataTemp.str_lastwritetime, lstr_SystemDateTime) THEN
ls_timestamp = string &
(datetime(date(lstr_SystemDateTime.wYear, &
lstr_SystemDateTime.wMonth, lstr_SystemDateTime.wDay), &
time(lstr_SystemDateTime.wHour, &
lstr_SystemDateTime.wMinute, lstr_SystemDateTime.wSecond)), &
"mm/dd/yyyy hh:mm:ss")
MessageBox("PB9", ls_timestamp)
END IF
END IF
ul_fileattributes in the os_finddata contains the file attribute, the possible (hex) value are