I can even delete the file manually from the explorer and then run this code, it still shows the old creation time. If I put a breakpoint on the using(.) line, I can see the file disappearing after the delete, but at the end it will still give me the old creation date. Using(var stream = new StreamWriter("hello"))Ĭonsole.WriteLine("ms", f.CreationTime, f.CreationTime.Millisecond) I ran the following code : File.Delete("hello") I just noticed a strange behavior with deleting and re-writing a file : the file creation time does not get updated if the interval is short enough between the two operations.
0 Comments
Leave a Reply. |