Hello,
For people who are aware of having an Unix like 'Touch' program, here are the sources + into the zipped attachement, a BAT to compile the source, the compiled source (a 3Kb one)
For people who are aware of having an Unix like 'Touch' program, here are the sources + into the zipped attachement, a BAT to compile the source, the compiled source (a 3Kb one)

Code: (c)
// ********************************
// Author : Gerome GUILLEMIN
// Coded in pure C using LCC Win32
// Date : 29 th of September 2006
// ********************************
#include <windows.h>
#include <stdio.h>
BOOL SetFileToCurrentTime(HANDLE);
int main(int argc, char **argv)
{
HANDLE lngHandle = NULL;
char szFileName[MAX_PATH+1];
if ( argc == 2 ) {
strcpy( szFileName, argv[1] );
lngHandle = CreateFile(szFileName, GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);
if (lngHandle && lngHandle != INVALID_HANDLE_VALUE) {
SetFileToCurrentTime( lngHandle );
CloseHandle( lngHandle );
return 1; // => 1 will be the OK return
}
}
return 0; // => 0 will be the KO return
}
BOOL SetFileToCurrentTime(HANDLE hFile)
{
FILETIME ft;
SYSTEMTIME st;
GetSystemTime(&st); // gets current time
SystemTimeToFileTime(&st, &ft); // converts to file time format
return SetFileTime(hFile, // sets last-write time for file
(LPFILETIME)NULL, (LPFILETIME)NULL, &ft);
}



- carpe noctem



.
.








