How do I change the write time of a file?

I’m writing a program where I can make changes to a series of text file in a client directory, run the “extract” process which should notice which files in the client directory were changed since the last update process, read the client files and update the server files.

The problem is that the server files now think they are newer than the client files. I’d like to be able to set the time write of the server files equal to the time write of the client file.

I’m using fopen, fread, fwrite and fclose. Is there a way that I can define the time write of a file to set it to whatever I want it to be?
What OS is this for?
if your on Unix, the 'touch' command.
This is an old "C", not even "C++", console ap that runs fine on Windows XP. I gave it to a friend who has used it a while then switched to Window's 7 which does not update last access time without a system patch.

It is an SSI (Server Side Include) emulator. You modify full HTML files in the Client directory, then “Update” your site. It compares the timestamps of the SHTM files in the Server directory to HTM files in the Client directory to figure out what you did. It re-extracts the “flagged” included files, and then uses timestamps of all the files to figure out which Client files require re-building.

Windows 7 doesn’t update access times to minimized disk IO. I need to be in control of the file timestamps so I don’t have to rely on OS changes.

It gives you all the benefits of SSI without the need for a server to preview your pages. If anyone is interested in it, just let me know.
Last edited on
Topic archived. No new replies allowed.