12-30-2005, 11:39 AM
str sFile="$desktop$\test.txt"
dll kernel32 #CreateFile $lpFileName dwDesiredAccess dwShareMode SECURITY_ATTRIBUTES*lpSecurityAttributes dwCreationDisposition dwFlagsAndAttributes hTemplateFile
dll kernel32 #SetFileTime hFile FILETIME*lpCreationTime FILETIME*lpLastAccessTime FILETIME*lpLastWriteTime
def FILE_WRITE_ATTRIBUTES (0x100)
def OPEN_EXISTING 3
int hfile=CreateFile(_s.expandpath(sFile) FILE_WRITE_ATTRIBUTES 0 0 OPEN_EXISTING 0 0)
if(hfile=-1) end _s.dllerror()
DATE d.getclock
FILETIME ft ftutc
d.tofiletime(ft)
LocalFileTimeToFileTime &ft &ftutc
SetFileTime hfile 0 0 &ftutc
CloseHandle hfile