Obviously it gets updated during a write operation, but are there any non-destructive operations that also force an update? Basically looking to be able to do the equivalent of the *nix touch command, but in C# programmatically.
+8
A:
Use the function SetFileTime (C++) or File.SetLastWriteTime (C#) to set the last write time to the current time.
FigBug
2008-11-20 19:43:20
Excellent, thanks much! I figured it would be simple, but I'm still learning my way around the .Net framework... Sometimes even simple things can be hard to find... :)
Brian Knoblauch
2008-11-20 19:55:08
+3
A:
From .NET, use the LastWriteTime property of the FileSystemInfo object. There is, in fact, a complete Touch app in example of that property in the MSDN.
James Curran
2008-11-20 19:44:29