🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Cannot retrieve file date

#872
From: Remy Lebeau (TeamB)
Date: Wed, 02 Jan 2008 22:35
30 lines
2028 bytes
"Jos�" <jose@127.0.0.1> wrote in message 
news:5p0on3lb068m6ob82jeg8565fmt5e2fsh4@4ax.com...

> The help file only says that a handle must be passed, so it's
> obvious to use fopen().

You are reading the Win32 API help file.  It has no concept of the C runtime 
functions.  Everything in that help files expects handles that are provided 
by the Win32 API only.

> Anyhow, CreateFile() won't do, I want to know the time of an existing 
> file.

In order to use GetFiletime(), you must use CreateFile() to get a suitable 
file handle.  Otherwise, use stat() or fstat() instead.

> It is usually not very useful to create a file and obtain the date
> immediately afterwards.

If you read the documentation for CreateFile(), you will see that it is used 
for both opening existing files as well as creating new files.

> My only current solution is findfirst() . This also returns the date of a 
> file.

That is another option.


Gambit 
Technical Details
Message-ID: <477c11fb$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <hfonn3l8o175ht0j11i9d4q5msanpr6apt@4ax.com> <477bfc32$3@newsgroups.borland.com> <5p0on3lb068m6ob82jeg8565fmt5e2fsh4@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4011bf1b28cc5925
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <hfonn3l8o175ht0j11i9d4q5msanpr6apt@4ax.com> <477bfc32$3@newsgroups.borland.com> <5p0on3lb068m6ob82jeg8565fmt5e2fsh4@4ax.com>
Subject: Re: Cannot retrieve file date
Date: Wed, 2 Jan 2008 14:35:00 -0800
Lines: 32
Organization: Lebeau Software
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: 207.178.157.90
Message-ID: <477c11fb$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1199313403 207.178.157.90 (2 Jan 2008 14:36:43 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail