Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.

ID: 20359, Find-File Wrapper - Easy Peasy

by David Carboni Email: Anonymous

Ultra-simple interface object for FindFirst/FindNext. Single-unit, self-managing instance that returns a TStringList of filenames. (D7)
Download Details
FTP  download also available
CDN Login Required to Download. (You will be redirected to the login page if you click on the Download Link)
To download this, you must have registered:
A free membership

For Delphi, Version 6.0  to 7.0 288 downloads
Copyright: No significant restrictions

Size: 1,039 bytes
Updated on Sat, 26 Jul 2003 06:13:13 GMT
Originally uploaded on Sat, 26 Jul 2003 05:03:11 GMT
SHA1 Hash: 01DC996E3A290C1FE95B1899EFE66B9E4451E179
MD5 Hash: 1C1242DC1EFBE196D74532FBFD5AB8D2

    Explore the files in this upload

This unit is designed to provide ultra-simple, ultra-rad FindFirst/FindNext use.

I got tired of re-writing directory-listing code and wanted an object I could just link to and request a file-list from, so I have written this unit.

Add the unit to your uses clause and call:

- FindFile.Path:='c:\temp'
- MyStringList:=FindFile.Find;

The object has two fields:

Path : string // the path to search
Pattern : string // defaults to '*.*'

No initialisation, creation or destruction required: The unit contains a class called tFindFile and a "self-managing instace", which is auto-created on first use and auto-destroyed on app shutdown - so no initialisation required, just call the methods.

Self-Managing: When you first access the instance, it is automatically created, so no memory is used until it is actually needed. When the app shuts down, it is destroyed (if necessary) in the finalization. It can also destroyed manually if required and will automatically be re-created if it is used again.

I have not developed any more advanced methods yet, as it seems that a TStringList of files matching a certain pattern, in a directory, is the most useful.

It might be nice to add FindFiles() and FindDirectories() and enventually, perhaps file attributes and even CRC, but I believe in minimalist programming - don't write it until you need it. It may never be useful and there'll probably be bugs in it!


For more information, see

   Latest Comments  View All Add New

Move mouse over comment to see the full text

Could not retrieve comments. Please try again later.

Server Response from: ETNACDC03