Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17



Posted on 1999-07-08
Medium Priority
Last Modified: 2010-04-06
How can I get a list of files in directory (not with file list box); Some API or other procedure...........

Question by:desno
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 27

Accepted Solution

kretzschmar earned 200 total points
ID: 1387260
hi desno,

from a q from my paq see below

      i can give you a scelleton

      procedure FindFile(PathFileName : string; IncludeSubDirs : Boolean);
        srec : TSearchRec;
        Path, FileName : String;
       Path := ExtractFilePath(PathFileName);
       FileName := ExtractFileName(PathFileName);

       // CurrentDirectory
       if findfirst(PathFileName,faanyfile,srec) = 0 then
           If Not(srec.attr and fadirectory > 0) then

                //Do something, get the name (Srec.Name) and fill your list
                //inc a counter (Inc(MyCounter))

         Until findnext(srec) <> 0;
       { SubDirectories }
       If IncludeSubDirs then
         if FindFirst(Path+'*.*',FaAnyFile,Srec) = 0 then
             // StartRecursion
             if not(Srec.Name[1] = '.') and (srec.attr and fadirectory > 0)then
               FindFile(Path + Srec.Name + '\' + FileName,IncludeSubDirs)
           Until findnext(srec) <> 0;


Author Comment

ID: 1387261

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question