🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: FileExists() is using wildcards

#10393
From: Hans Galema
Date: Tue, 27 Apr 2004 09:37
36 lines
2410 bytes
Remy Lebeau (TeamB) wrote:

> Upon further examination, FileExists() calls FileAge(), which in turn calls
> FindFirstFile(), which then returns the first filename matching the
> specified mask. 

Thanks for your effort and the given info.

 > FileExists() is not meant to support wildcards, it is
> merely a side-effect due to Microsoft's own API design.

So it does support wildcards. As is stated in the Subject of this
thread.

>>No I do not need wildcard matching. I need a file exist
>>function that reports if a file for a filename exists.
> 
> That is what FileExists() does.

The allowing of wildcards was unexpected behaviour for me. My own
file_exist() function (as shown in my first post) has expected behaviour.

> Then you will have to validate the filename to see if it contains any
> invalid characters before then testing for its existance in the file system.
> Otherwise, stop using buggy generated code in the first place.

Heee. There is nothing buggy in my code that generates the filename.
It nicely places '?'s on occasions.

>>The intention of using FileExist was to get a false for
>>unvalid filenames. To my surprise FileExist does not
>>care for unvalid filenames, but allows wildcards in them.

That was what I said.

Hans.
Technical Details
Message-ID: <408e2856$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> <408d8056$1@newsgroups.borland.com> <408e0d6a$1@newsgroups.borland.com> <408e1c4a$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 02:39:23 PST
Date: Tue, 27 Apr 2004 11:37:54 +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> <408d8056$1@newsgroups.borland.com> <408e0d6a$1@newsgroups.borland.com> <408e1c4a$1@newsgroups.borland.com>
In-Reply-To: <408e1c4a$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: <408e2856$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1083058262 129.125.202.241 (27 Apr 2004 02:31:02 -0700)
Lines: 36
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