I'd like to create a file with an invalid created/modified/accessed timestamp to use in unit tests to ensure that my application can handle files with invalid timestamps. It's a Windows application written in C# that could run on both NTFS and FAT32 filesystems.
Thanks, this is useful though doesn't seem to let you set invalid dates
tjrobinson
2010-10-07 12:44:44
+1
A:
Have a look at the opensource 'Touch for Windows'.
It updates the dates associated with a file to whatever you want it to be. It can change access, modification and creation dates. You as a user can update them independently of each other, you can update them with any possible date. Dates can be now, user specified or copied from another file. If you try to touch a file which does not exist, this command will create it for you (empty of course).
Have a look and download the source here.
James - built2order
2010-10-14 10:22:06
Thanks, this is useful though doesn't seem to let you set invalid dates as it still uses the Win32 API
tjrobinson
2010-10-19 08:45:01