Login | |
|
 |
RE: Deleting a file, creating a new one... - 4/30/2008 3:05:24 AM
|
|
 |
|
| |
ebgreen
Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
|
Unfortunately it doesn't happen for me. This code works fine: Set fso = CreateObject("Scripting.FileSystemObject") WScript.Echo "Before delete: " & fso.GetFile("C:\Test.txt").DateLastModified fso.DeleteFile "c:\test.txt" WScript.Sleep 3000 Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set f = fso.OpenTextFile("c:\test.txt", ForWriting, True) f.WriteLine date() & " " & time() & " - " f.Close
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: Deleting a file, creating a new one... - 4/30/2008 3:45:58 AM
|
|
 |
|
| |
ebgreen
Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
|
Aaah...yes you are correct that I see that behavior for DateCreated. Hmmm...odd I will look into this. I'm curious though why you need to rely on DateCreated instead of DateLastModified?
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: Deleting a file, creating a new one... - 4/30/2008 7:49:57 AM
|
|
 |
|
| |
Rischip
Posts: 414
Score: 2
Joined: 3/26/2007
Status: offline
|
On my system it appears that the actual delete on the physical drive and the create require a 20 second delay for the cache to clear out. That's 20 seconds between operations before the cache clears or else the new file will contain the old create date.
_____________________________
Rischip Author of - The Grim Linker
|
|
| |
|
|
|
|
|