🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Determining an files true type

#228
From: Ed Mulroy [TeamB]
Date: Tue, 15 Jul 2008 00:22
29 lines
1989 bytes
Try using this:

bool WINAPI IsExeName(const WIN32_FIND_DATA & wfd)
  {
  const char *exten = strrchr(wfd.cFileName, '.');

  return (exten != NULL) && !stricmp(exten, ".ext");
  }
              :
              :
    if (IsExeName(fdFindFileData))
        // add to my list

.  Ed

> Mike Collins wrote in message
> news:487bd893@newsgroups.borland.com...
>
> Got a bit of a conceptual question here.  I have a piece of code that 
> performs a recursive search of the users hard disk and generates a list of 
> files.  Nothing new here.  My code is based around the FindFirstFile / 
> FindNextFile API's.  From what I can see, there doesn't seem to be a way 
> to specify a wildcard search mask i.e. *.exe so it seems necessary to 
> check for .exe extension within the search, which I do like this:
>
>    AnsiString sFile = (AnsiString)fdFindFileData.cFileName;
>    if (ExtractFileExt(sFile).AnsiCompareIC(".exe")== 0)
>       // add to my list
> ...
Technical Details
Message-ID: <487bedaa$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <487bd893@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,179fe31b934cb3c9
X-Google-Attributes: gid10cc67,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <487bd893@newsgroups.borland.com>
Subject: Re: Determining an files true type
Date: Mon, 14 Jul 2008 20:22:05 -0400
Lines: 31
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
NNTP-Posting-Host: 69.142.0.27
Message-ID: <487bedaa$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1216081322 69.142.0.27 (14 Jul 2008 17:22:02 -0700)
X-Authenticated-User: edmulroy
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
X-Original-Bytes: 1834