Thanks
Hemlata
Look at the way of_GetLastWriteDateTime() in the PFC file services is
implemented.
--
Regards,
Millard [TeamSybase]
<Hemlata Tripathi> wrote in message
news:43d6642b.7f4...@sybase.com...
Pass in the full path to the file, and 3 datetime reference variables
to get the 3 types of timestamps on a file. I believe the one you are
looking for (modified) is the 3rd one (adt_write).
// ***************************************************************
// iGetFileTime (32 bit only)
//
// Parms:
// by VALUE as_File = Name of file
// by REF adt_creation = Creation time
// by REF adt_access = Last access time
// by REF adt_write = Last write time
//
// Obtains creation, access and write times of the specified file
//
// Returns: True is successfull or False if failure
//
// REV DATE INIT REASON
//
// references:
// http://www.pmsys.com/pb
//
// *********** must also include the following external functions:
//Function Boolean CloseHandle(ulong hfile) Library "kernel32.dll"
//Function boolean FileTimeToSystemTime(ref filetime lpcreate, ref
systemtime lpsystem) //Library "kernel32.dll"
//Function boolean GetFileTime(ulong hfile, ref filetime lpcreate, ref
filetime lpaccess, ref //filetime lpwrite) Library "kernel32.dll"
//Function ulong OpenFile (ref string lpszFileName, ref str_ofstruct
ofstruct, uint fuMode) //Library "kernel32.dll"
// *********** must also include the following structures created:
//type str_ofstruct from structure
// long cBytes
// long fFixedDisk
// unsignedinteger nErrCode
// unsignedinteger Reserved1
// unsignedinteger Reserved2
// character szPathName[512]
//end type
//
//type filetime from structure
// ulong lowdate
// ulong highdate
//end type
//
//type systemtime from structure
// unsignedinteger wyear
// unsignedinteger wmonth
// unsignedinteger wdayofweek
// unsignedinteger wday
// unsignedinteger whour
// unsignedinteger wminute
// unsignedinteger wsecond
// unsignedinteger wmillisecond
//end type
//
// ***************************************************************
ulong hfile
boolean rtn
date ld_date
time lt_time
filetime lstr_create
filetime lstr_access
filetime lstr_write
systemtime lstr_system
str_ofstruct lstr_ofstruct
environment lstr_env
// Obtain our system environment
IF GetEnvironment(lstr_env) <> 1 THEN
MessageBox("Error","Error obtaining system environment!")
Halt
End If
CHOOSE CASE lstr_env.Win16
CASE True
MessageBox("Error","GetFileTime cannot be used in 16 bit
mode!")
Return -1
Case Else
hfile = OpenFile(as_file, lstr_ofstruct, 0)
If hfile<1 Then Return 0
rtn = GetFileTime(hfile, lstr_create, lstr_access, lstr_write)
If Not rtn Then Return 0
rtn = CloseHandle(hfile)
If Not rtn Then Return 0
// Convert dates
rtn = FileTimeToSystemTime(lstr_create,lstr_system)
If Not rtn Then Return 0
adt_creation = DateTime( &
Date( &
String(lstr_system.wmonth) + "/" + &
String(lstr_system.wday) + "/" + &
String(lstr_system.wyear)), &
Time( &
String(lstr_system.whour) + ":" + &
String(lstr_system.wminute) + ":" + &
String(lstr_system.wsecond)))
rtn = FileTimeToSystemTime(lstr_access,lstr_system)
If Not rtn Then Return 0
adt_access = DateTime( &
Date( &
String(lstr_system.wmonth) + "/" + &
String(lstr_system.wday) + "/" + &
String(lstr_system.wyear)), &
Time( &
String(lstr_system.whour) + ":" + &
String(lstr_system.wminute) + ":" + &
String(lstr_system.wsecond)))
rtn = FileTimeToSystemTime(lstr_write,lstr_system)
If Not rtn Then Return 0
adt_write = DateTime( &
Date( &
String(lstr_system.wmonth) + "/" + &
String(lstr_system.wday) + "/" + &
String(lstr_system.wyear)), &
Time( &
String(lstr_system.whour) + ":" + &
String(lstr_system.wminute) + ":" + &
String(lstr_system.wsecond)))
End Choose
Return -1
steve
[TeamSybase]
<Hemlata Tripathi> wrote in message
news:43df78dc.3c1...@sybase.com...
--
Regards,
Millard [TeamSybase]
"Steve Katz [TeamSybase]" <steve...@teamsybase.com> wrote in message
news:43e046a4$1@forums-1-dub...