Modify the date/time stamp in code
-
Does anyone out there know where to start looking? I want it fairly flexible so I can update the version and time stamp etc. for building my own custom make files :) from Visual C++ Cheers all, Al. "When I left you I was but the learner, now I am the master" - Darth Vader
-
Does anyone out there know where to start looking? I want it fairly flexible so I can update the version and time stamp etc. for building my own custom make files :) from Visual C++ Cheers all, Al. "When I left you I was but the learner, now I am the master" - Darth Vader
Your question is somewhat vague. What exactly are you trying to accomplish? It hints at needing a touch utility, but I can't be for sure at this point.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
-
Does anyone out there know where to start looking? I want it fairly flexible so I can update the version and time stamp etc. for building my own custom make files :) from Visual C++ Cheers all, Al. "When I left you I was but the learner, now I am the master" - Darth Vader
as David wrote, touch will change the date and time of a file. normally, when a file is edited ( and saved ) , its time will automatically be modified; so no real use to modify the date itself. or are you talking about the $Date$ or $Revision$ version control tag ?
Maximilien Lincourt Your Head A Splode - Strong Bad
-
Does anyone out there know where to start looking? I want it fairly flexible so I can update the version and time stamp etc. for building my own custom make files :) from Visual C++ Cheers all, Al. "When I left you I was but the learner, now I am the master" - Darth Vader
Hi Guys, Thanks for replying to my message so soon. Sorry about the vague message I was just leaving work. Basically, I'm creating my own make file generator that scans the current .vcproj file for dependencies - which it does. However, I don't want it to be generating a makefile *every* time it compiles because the dependencies probably wouldn't have changed (unless a new file had been added or removed, but then it gets saved and a new time stamp), so my idea was to check if the .mak and .vcproj date and time stamps were the same, if they weren't my utility would generate the .mak file and set the date and time stamps to be the same as the .vcproj. I know I could just check if the .mak file is older than the .vcproj but I wanted proper versioning to be linked in as well and am currently extending my io class so it can do pointless things like this for any future tasks I might have :). I'm using C++ (no MFC or anything) to do it, but google seems to give me a billion things I really don't want at all. Hope you can help, thanks for taking the time to look over this message, Al. "When I left you I was but the learner, now I am the master" - Darth Vader
-
Hi Guys, Thanks for replying to my message so soon. Sorry about the vague message I was just leaving work. Basically, I'm creating my own make file generator that scans the current .vcproj file for dependencies - which it does. However, I don't want it to be generating a makefile *every* time it compiles because the dependencies probably wouldn't have changed (unless a new file had been added or removed, but then it gets saved and a new time stamp), so my idea was to check if the .mak and .vcproj date and time stamps were the same, if they weren't my utility would generate the .mak file and set the date and time stamps to be the same as the .vcproj. I know I could just check if the .mak file is older than the .vcproj but I wanted proper versioning to be linked in as well and am currently extending my io class so it can do pointless things like this for any future tasks I might have :). I'm using C++ (no MFC or anything) to do it, but google seems to give me a billion things I really don't want at all. Hope you can help, thanks for taking the time to look over this message, Al. "When I left you I was but the learner, now I am the master" - Darth Vader
I eventually found this 'undocumented' function (well it is documented, but yet again its the last thing MSDN wants to pull out from its library) which does *exactly* what I want it to do. _futime(int, _utimbuf) allows you to modify the time accessed and modified of a file that you have currently loaded with a valid os descriptor handle (use _futime(char*, _utimbuf) for MFC or people who don't have an os descriptor handle - specify the filename and path of the file to change instead). The _utimbuf has two components (for access and modify sections of the file properties) that must both be valid for it to succeed. Its that easy! But yet again the absolute heap of crap that is MSDN pulls out a billion results that include everything BUT what your looking for. I only stumbled across this by complete and utter fluke. When are we gonna see a comprehensive and intelligent help engine with VS? I have .NET 2003 and its nowhere near as intelligent as Delphi v5 help engine which is now nearly 5 years old! But at least code project is cool. "When I left you I was but the learner, now I am the master" - Darth Vader