Re: How do you use FindFirstFile ?
- From: "Severian [MVP]" <severian@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 20 Jul 2005 02:02:36 GMT
On Tue, 19 Jul 2005 13:13:58 -0700, "Eugene Gershnik"
<gershnik@xxxxxxxxxxx> wrote:
>Timothy Madden wrote:
>>
>> What I actualy need is to see if a file exists and the only documented
>> way to do it that I could find is to use SearchPath.
>
>The only documented way to check for file existence is to open the file. Why
>doesn't it work for you?
GetFileAttributes() is somewhat more reliable and faster, as it will
succeed if the file exists and is accessible (per security/ACL), while
opening the file will fail if it is opened by another process without
appropriate sharing.
FindFirstFile and the _stat family from the CRT (which I believe
eventually call FindFirstFile) are other possibilities, but measurably
slower than GetFileAttributes.
--
Phillip Crews aka Severian
Microsoft MVP, Windows SDK
Posting email address is real, but please post replies on the newsgroup.
.
- Follow-Ups:
- Re: How do you use FindFirstFile ?
- From: Eugene Gershnik
- Re: How do you use FindFirstFile ?
- References:
- How do you use FindFirstFile ?
- From: Timothy Madden
- Re: How do you use FindFirstFile ?
- From: Eugene Gershnik
- How do you use FindFirstFile ?
- Prev by Date: Re: How not to exhaust available memory ?
- Next by Date: Re: CreateFileMapping & MapViewOfFile
- Previous by thread: Re: How do you use FindFirstFile ?
- Next by thread: Re: How do you use FindFirstFile ?
- Index(es):
Relevant Pages
|