Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
C++CodeIDE

C++Builder Developer on StackOverflow was having trouble with SysUtils FindFirst / FindNext not finding all files with extension ~1~ and other strange file extensions.

Here was my answer 😀

Create a New | C++Builder VCL Windows application. On the form add TPanel, TButton, TEdit and TMemo components. Put the TButton and TEdit into the TPanel. Set TPanel align property to AlTop. Set the TMemo align property to alClient.

FindFirst’s declaration in SysUtils.hpp is:

The key point is to included any or all of the file attributes (integer parameter Attr) for files that you want to find. The file attribute choices are defined in “C:\Program Files (x86)\Embarcadero\Studio\21.0\include\windows\rtl\windows\rtl\System.SysUtils.hpp”:

The following code will display all items in a directory including the ., .., .~* files – for example in a C++Builder project’s history folder.

I put the string: C:\Users\david\Documents\Embarcadero\Studio\Projects\CBuilder\FindFirstVCLCpp\__history\*.* in the EditBox. After clicking the Button, the TMemo contained the following contents.

Screen Grab of running C++Builder FindFirst app

References

System.SysUtils.FindFirst

System.SysUtils.FindNext

To find more C++Builder StackOverflow questions and answers use the C++Builder SO Tag 😀


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

Get some love as Delphi turns 26
Related posts
C++DelphiTech Partner

Quickly Create Fast Peer-To-Peer Communication Between Windows Processes

C++DelphiNewsRAD Studio

RAD Studio 10.4.2 Silent Installer Makes It Easy To Automate The Installation Process

DatabaseInterBase

Quickly Embed Award-Winning Cross-Platform SQL Database: InterBase ToGo

C++CodeRAD Studio

LearnCPlusPlusOrg :: Counting Prime Number Benchmarks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES