|
of_setlastaccessdate
|
|
Full name
|
pfc_n_cst_filesrvaix.of_setlastaccessdate
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_setlastaccessdate(string,date)
|
Name
|
Datatype
|
lb_Ret
|
boolean
|
lstr_Empty
|
os_filedatetime
|
lstr_FileInfo
|
os_fileopeninfo
|
lstr_FileTime
|
os_filedatetime
|
lt_Time
|
time
|
lul_handle
|
ulong
|
public function integer of_setlastaccessdate (string as_filename, date ad_date);//////////////////////////////////////////////////////////////////////////////
// Public Function: of_SetLastAccessDate
// Arguments: as_FileName The name of the file to be updated.
// ad_Date The date to be set.
// Returns: Integer
// 1 if successful,
// -1 if an error occurrs.
// Description: Set the Last Access Date on a file.
//////////////////////////////////////////////////////////////////////////////
// Rev. History: Version
// 6.0 Initial version
//////////////////////////////////////////////////////////////////////////////
// Copyright © 1996-1999 Sybase, Inc. and its subsidiaries. All rights reserved. Any distribution of the
// PowerBuilder Foundation Classes (PFC) source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//////////////////////////////////////////////////////////////////////////////
boolean lb_Ret
ulong lul_handle
time lt_Time
os_filedatetime lstr_FileTime, lstr_Empty
os_fileopeninfo lstr_FileInfo
// Convert the date and time
If of_ConvertPBDatetimeToFile(ad_Date, lt_Time, lstr_FileTime) < 0 Then Return -1
// Set the file structure information
lstr_FileInfo.c_fixed_disk = "~000"
lstr_FileInfo.c_pathname = as_FileName
lstr_FileInfo.c_length = "~142"
// Open the file
lul_handle = OpenFile ( as_filename, lstr_FileInfo, 2 )
If lul_handle < 1 Then Return -1
lb_Ret = SetFileTime(lul_handle, lstr_Empty, lstr_FileTime, lstr_Empty)
CloseHandle(lul_handle)
If lb_Ret Then
Return 1
Else
Return -1
End If
end function