Click to See Complete Forum and Search --> : bad file creation time
leofv
January 23rd, 2003, 05:10 AM
Hi all,
If I create a file ('test.txt'), wait some seconds, delete it, and then create it again with the same filename, the file 'creation time' of the new file is bad: it is the same as from the deleted one.
How is this possible?
dimm_coder
January 24th, 2003, 07:06 AM
What OS do U use?
It is may be possible for this reason:
Some operations with the file system is cashed, so if U deleted a file , it marks it somewere in cash for next processing, but if U then (after a little time) make it again, it find it from this cash and restore old record for it. It is of course strange why for creating.
I try it to see if it so for my systems (Linux and Win 2000,XP).
leofv
January 24th, 2003, 09:29 AM
I tested it on NT4 and W2K. In both cases it went wrong. You can test it very easily with windows explorer: create a new file 'test.txt', delete it and create it again.
Is this a bug in windows? Is there a workaround for this problem? The problem is that I need to delete a file (depending on its creation date) and then create it again (with a new creation date).
dimm_coder
January 28th, 2003, 02:53 AM
May be it would be possible to read about it in the book about the file system realization.
If U delete and create files by your program, U can use SetFileTime() API-function to set the time U need.
leofv
January 31st, 2003, 09:55 AM
Thanks for the suggestion to use SetFileTime() function. This solved my problem.
I still wonder if there is a bug in windows.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.