🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: FileExists() is using wildcards

#10394
From: Hans Galema
Date: Tue, 27 Apr 2004 09:52
21 lines
1566 bytes
Remy Lebeau (TeamB) wrote:

> INVALID_FILE_ATTRIBUTES was not added to BCB under BCB6.
> 
> Just test for 0xFFFFFFFF directly, since that is the actual value
> GetFileAttributes() returns on error.

Changed the code to:

   bool MyFileExists3(const char *fname)
     {
     DWORD a = GetFileAttributes(fname);

     if ( a == 0xFFFFFFFF ) return false;

     return !(a & FILE_ATTRIBUTE_DIRECTORY);
     }

Thanks.

Hans.
Technical Details
Message-ID: <408e2bcc$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <408d6cad$1@newsgroups.borland.com> <408d73fa$1@newsgroups.borland.com> <408e0d39$2@newsgroups.borland.com> <408e1c08$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,8374fb71f8a662f4
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-04-27 03:09:54 PST
Date: Tue, 27 Apr 2004 11:52:41 +0200
From: Hans Galema <dontusethis@dontusethis.nl>
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.6b) Gecko/20031208
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: FileExists() is using wildcards
References: <408d6cad$1@newsgroups.borland.com> <408d73fa$1@newsgroups.borland.com> <408e0d39$2@newsgroups.borland.com> <408e1c08$1@newsgroups.borland.com>
In-Reply-To: <408e1c08$1@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 129.125.202.241
Message-ID: <408e2bcc$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1083059148 129.125.202.241 (27 Apr 2004 02:45:48 -0700)
Lines: 21
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail