strange file creation date...

Ok, i am looking more for a reason than code for this problem.....

1 - I use the normal assign, rewrite, closefile, commands to create a text file on the hard drive - so far no problem.

2 - I then delete the file via windows explorer and re-run the program again to create the file again. - still no problem.

the creation date and time of the second file is exactly the same as the first file i created AND deleted - problem!

Anyone know what is going on and why it is doing that?

I even used CreateFile to see if it was some oddity with delphi but the same happens.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Wim ten BrinkSelf-employed developerCommented:
Windows explorer just kicks the file to the recycle bin. Try emptying the recycle bin before creating the file again. It this solved the "problem" then it's caused because Windows just doesn't delete the file, but just marks it for deletion. Thus, when you create it again, it doesn't create a new file but just empties the old file...
If this doesn't solve this then I'm as stunned as you are. ;-)
foxjaxAuthor Commented:
ok, i tested the solution you gave and it seems to have worked.

Strange that the "problem" does not happen on an NTFS system - it works as i expected.

Do you know of any "down" side of this behaviour i might need to take into account (or "feature" as microsoft would have us call it)?
Wim ten BrinkSelf-employed developerCommented:
The only down side of this would be that some applications might not notice that a file has changed because they compare the timestamp with a previous timestamp that has been stored in their system. (With Delphi this could mean that a source file that you create dynamically won't be recompiled during a compile because the compiled DCU just contains the timestamp of the original source, which hasn't changed.)

Then again, if this is FAT or FAT32 related then you now have one reason to change to NTFS. ;-)
With FAT(32) you have windows storing folder information in several disk sectors. This FAT table just contains filenames and timestamps and a link to the sectors where the file is actually stored. If a file is deleted, the FAT entry is just marked as deleted. When you create the file again, Windows notices that the file used to be there and perhaps re-uses the FAT entry for this file.

It is a bit mysterious, though...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
foxjaxAuthor Commented:
mysterious is one way of putting it - one other "interesting" aspect i have now noticed is that if i create the file via the delphi program then delete it and wait about 3-5 minutes without emptying the recycle bin - and then re-run the program to re-create the file....all works as it is supposed to.

I suspected that perhaps the indexing service was to blame but then realized i had turned it off the first day on installing windows.

kind of makes it a real pain when you're trying to put some decent quality into a program to find that Windows comes up with something odd to mess it all up :(

foxjaxAuthor Commented:
> you now have one reason to change to NTFS

True, but i just did a few more tests on NTFS and it seems to be embedded with the same "feature" too.

Well, thanks for the help.  At least the information is out there for others to read if they get the same "problem" and realize....they are not alone :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.