Re: Wrong Creation Date for Files

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: mikeb (mailbox.google_at_nospam.mailnull.com)
Date: 06/22/04


Date: Tue, 22 Jun 2004 08:31:32 -0700

Steven Blair wrote:
> Hi,
>
> I have a trace log file for a system I am writing. If the creation date
> is older than 14 days, I have to rename that file (File.Move). The next
> time a trace message is required a new file is created
>
> StreamWriter sw = new StreamWriter(path,true);
>
> The problem is, the creation date of this new file has the creation date
> of the previous log file :S and not the present date.
>
> I used a freeware app to change the creation date of the original file.
>
> The new file definately does not exists before creation (File.Exist is
> used)
>

This is due to a feature of the operating system, called tunneling, to
support applications that create file backups by renaming a file (for
example to *.bak), then create a new file with the original name or some
similar variation on that theme. This way the filesystem maintains the
original file's 'state' in the new file (which *is* the original file
as far as the user is concerned).

See KB172190 for more information:

      http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B172190

-- 
mikeb


Relevant Pages

  • Wrong Creation Date for Files
    ... I have a trace log file for a system I am writing. ... I have to rename that file. ... the creation date of this new file has the creation date ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Word properties
    ... >> document properties tab stores and changes the date a document was created, ... > accessed date will be the date that copy was created (not the creation ... > date of the original file), but the modified date won't change until it ...
    (microsoft.public.windowsxp.general)
  • Re: Word properties
    ... Jackie D wrote: ... Steve ... >>accessed date will be the date that copy was created (not the creation ... >>date of the original file), but the modified date won't change until it ...
    (microsoft.public.windowsxp.general)
  • Re: How retain CREATED date?
    ... Windows resets the created date to the current system time/date. ... > Is there a way to retain the created date of the original file? ... creation date refers to the file, while the modification date refers to ... If the creation date is really important to you, ...
    (microsoft.public.win2000.general)
  • Re: What about deleting sub-folders
    ... to reflect the correct path in the log file. ... it should not be able to prompt for anything cos i want to schedule it ...
    (microsoft.public.scripting.vbscript)