Solved

File listing source

Posted on 1997-11-02
2
222 Views
Last Modified: 2010-04-16
Has anyone got source code for a file listing program that will allow me to do the following.
1) quick sorting procedure/function
2) Allow me to choose what files to display eg:- FileExts:=(txt,doc,diz,me), So that it will show files only with those extensions.
3) Long file name handling would be a bonus but optional.

I know this may be a big ask, But any help would be appreciated.

Many thanks in advance.
Renegade.
0
Comment
Question by:Renegade
[X]
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
2 Comments
 
LVL 1

Accepted Solution

by:
Odie earned 100 total points
ID: 1216421
uses WinDos, Strings;

const
 Directory: String
          = 'C:\';
 NrOfMasks = 3;
 Masks: array[1..NrOfMasks] of String
           = ('*.bat', '*.sys', '*.exe');

var
 SearchRec: TSearchRec;
 X: Integer;
 PC: PChar;

begin
 GetMem(PC, 256);
 for X := 1 to NrOfMasks do begin
   StrPCopy(PC, Directory + Masks[X]);
   FindFirst(PC, faAnyFile, SearchRec);
   while (DosError = 0) do begin
     WriteLn(SearchRec.Name);
     FindNext(SearchRec);
   end;
 end;
 FreeMem(PC, 256);
 ReadLn;
end.

This is sorted for each extension separatly.  I can sort it for all at once if necessary.

You can easily add size, attr. etc. (see TSearchRec in help)
0
 

Author Comment

by:Renegade
ID: 1216422
Thankyou for your help Odie. I should be able to use the routine in a dandy piece of snippet I found in the SWAG's to do what I want to do.

0

Featured Post

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

615 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