views:

33

answers:

3

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.

+1  A: 

If you are looking for a timestamp editor, I found this one useful.

http://code.google.com/p/stexbar/

bdhar
Thanks, this is useful though doesn't seem to let you set invalid dates
tjrobinson
+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
Thanks, this is useful though doesn't seem to let you set invalid dates as it still uses the Win32 API
tjrobinson
A: 

This is not possible.

tjrobinson