Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:18 pm
by allistar >> Sun, 5 Jan 2003 21:54:05 GMT
Hi there,
We have systems that do exactly that, by using a little bit of C++ trickery:
Here is a function in C that retrieves the modified time of a file:
extern "C" __declspec(dllexport)
void getFileModifiedTime(char *fileName, int *highBits, int *lowBits)
{
*highBits = 0;
*lowBits = 0;
HANDLE hFile = CreateFile(fileName, GENERIC_READ,
FILE_SHARE_READ, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
return;
FILETIME creation, lastAccess, lastWrite;
GetFileTime(hFile, &creation, &lastAccess, &lastWrite);
*highBits = lastWrite.dwHighDateTime;
*lowBits = lastWrite.dwLowDateTime;
CloseHandle(hFile);
}
Using that you should be able to easily create a similar function that sets the modified time instead of retrieves it. It is not hard to make that into an external function that you call from Jade (if you are
unsure how to do that I can give you some pointers).
You will have to temporarilty store the time in Jade a two integers, represented by "highBits" and "lowBits" in the above code.
Hopefully this helps,
Allistar.
------------------------------------------------------------------
Allistar Melville
Software Developer
Auckland, NEW ZEALAND
Greentree International,
Developer of Greentree Financial Software. ------------------------------------------------------------------