|
Answer» I have noticed a very strange BEHAVIOR when deleting a file and then immediately creating the file again. The created date doesn't change. See example below:
dir /TC test.txt
Returns...
01/07/2008 08:26 AM 7 test.txt
So the created date is 1/7/08 at 8:26 AM
I then run the following commands:
del test.txt echo test > test.txt
If I do the dir command again:
dir /TC test.txt
Returns...
01/07/2008 08:26 AM 7 test.txt
If I do a dir command with the "/TC" flag it returns the modified date:
dir test.txt
Returns:
01/07/2008 08:39 AM 7 test.txt
So... the modified date/time stamp changes but the creation date/time doesn't even though the file was deleted and recreated. I did notice that if I delete the file, wait about 30 seconds, and then recreate the file the creation date does change.
Has anyone else seen this behavior? Is there a way to force the creation date to change when recreating a file other that putting a delay into a script?
I've seen caching issues before SORT of like this where it says a file is in use, even though it is closed, in XP environment. Maybe my problem is unrelated to your date/time stamp issue, but if its RELATED to the same caching this should fix it.
My fix was to run this to from when at the Batches folder exit out to the C: root, then NAVIGATE back to the Batches Folder, so that it REFRESHES the file/folder status focus before the next command is executed.
cd\. cd Batches
Command will show up like below if not Echo Off ( Refreshing )
c:\Batches> c:\> c:\Batches>
Hope this simple process helps!
Dave
|