🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

FindFirstFile, FILETIME, and Daylight Savings

#10555
From: Bob Gonder
Date: Mon, 05 Apr 2004 00:30
24 lines
1984 bytes
I have a small utility that checks for new files and places them in a
database.
It uses FindFirstFile to scan the system.
When it finds an interesting file, it looks in the database for the
name. If found, it checks the ftCreationTime against the database. If
its the same time, ignore the file, otherwise add it to the database.
Works great every day except twice a year.....

The first time it's run after going into or out of Daylight Savings
Time, none of the file times match what's in the database.

When posting to the db (flat binary file, nothing fancy like SQL), I
use the raw ftCreationTime.  Then next time, I use CompareFileTime to
compare the saved value against the current ftCreationTime.

I thought ftCreation time was supposed to be UTC, and hence not
affected by DST changes.

What can I use to get a non-changing file time?

These files don't get modified, but occasionally they get replaced.
I need to detect replacement (creation time works fine except for the
DST problem).
Technical Details
Message-ID: <1c8170tliot8sh3tp2gfk0v61as6l3uqti@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsrout1.ntli.net!news.ntli.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,2bff2a2748be0347,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-04-04 17:39:20 PST
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: FindFirstFile, FILETIME, and Daylight Savings
Date: Sun, 04 Apr 2004 17:30:42 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <1c8170tliot8sh3tp2gfk0v61as6l3uqti@4ax.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 4.228.222.197
X-Trace: newsgroups.borland.com 1081125043 4.228.222.197 (4 Apr 2004 17:30:43 -0800)
Lines: 27
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsrout1.ntli.net!news.ntli.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail