Just for fun, here's a 1kb C (well, C++) version, that has proper system return code
Nice!
Here's a good link btw : http://smallcode.weblogs.us/category/optimization-tricks/
Just for fun, here's a 1kb C (well, C++) version, that has proper system return code

// ********************************
// Author : Gerome GUILLEMIN
// Coded in FBSL v3
// Date : 01st of October 2006
// ********************************
#DllDeclare Kernel32( "CreateFile", "CloseHandle", "GetSystemTime", "SystemTimeToFileTime", "SetFileTime" )
Function Main()
Dim %lngHandle = NULL
Dim $szFileName * MAX_PATH+1
If CommandCount() = 2 Then
StrCpy( szFileName, Command(1) )
lngHandle = CreateFile(szFileName, GENERIC_WRITE, _
FILE_SHARE_READ + FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0)
If lngHandle AndAlso lngHandle <> INVALID_HANDLE_VALUE Then
SetFileToCurrentTime( lngHandle )
CloseHandle( lngHandle )
Return 1 // => 1 will be the OK return
End If
End If
Return 0 // => 0 will be the KO return
End Function
Function SetFileToCurrentTime(Byval %hFile)
Dim $ft * 16 'FILETIME
Dim $st * 16 'SYSTEMTIME
GetSystemTime(@st) // gets current time
SystemTimeToFileTime(@st, @ft) // converts to file time format
Return SetFileTime(hFile, 0, 0, @ft) // sets last-write time for file
End FunctionOriginal address: https://www.donationcoder.com/forum/index.php?topic=5537.0