🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #6793

File attributes cached?

#6793
From: Patrick Rotsaert
Date: Mon, 11 Apr 2005 14:15
16 lines
1566 bytes
 Hi,

I'm writing a function to rotate log files. I use the file creation date to
decide when to rotate the log file. I then rename the file and after that
re-create the log file again. What bugs me is that the newly created file
has the same creation date as the one that was renamed just before. If I add
a delay of a few seconds between the rename and the create, the new file
gets a correct creation date. My guess is that this has something to do with
caching on ntfs. Is there a way around this?
B.t.w., for renaming, I tried all kinds of functions: rename (RTL),
RenameFile (VCL), MoveFile (WinAPI). For creating the file, I used
fopen(..., "at"), CreateFile (WinAPI) and FileCreate (VCL). All with the
same result !

Thanks,
Patrick.
Technical Details
Message-ID: <425a866c$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ed22dc6f0ef0f7cd,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Patrick Rotsaert" <patrick.rotsaert@tts-online.be>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: File attributes cached?
Date: Mon, 11 Apr 2005 16:15:08 +0200
Lines: 18
Organization: GVA
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 194.7.45.88
Message-ID: <425a866c$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1113228908 194.7.45.88 (11 Apr 2005 07:15:08 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail