Re: Dos comands
- From: "Henry Bartlett" <hambar@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 21 Jun 2005 08:12:02 +1000
"didi" <didi@xxxxxxxxxxxxxxx> wrote in message
news:9MCte.12806$F6.2765430@xxxxxxxxxxxxxxxx
> I am looking for
>
> tricks like
>
> *.* for search all files
> *.jpg for search all jpg files
It sounds as though you need information about "wildcards" in DOS.
AFAIK DOS (and WINDOWS) recognizes only 2 such characters: * and ?
Thes wildcards can be used in filenames but not in directory (path)
names.
* stands for any number (including 0) of characters
thus "P8*.jpg" would match "P8260019.jpg", "P8260020.jpg",
"P8home.jpg" and "P8.jpg" but not "P9260019.jpg"
"fred.h*" will match "fred.ht", "fred.htm", fred.HTML" but not
"freda.htm"
? stands for a single character
thus "P?260019.jpg" matches "P8260019.jpg", "P9260019.jpg",
"PX260019.jpg" but not "P8060019.jpg"
The simplest way to learn about wildcards is to open an MSDOS window
and try doing a dir with various combinations
eg dir ???.* (lists all 3 character filenames with any extension)
dir *.?? (list all files with 2 character extensions)
But to bring this back to Delphi, you can use the * and ? wildcards in
the Path parameter supplied to the FindFirst function.
eg FindFirst ('c:\temp\*.jp*', faAnyFile, MySearchRec) to locate all
JPEG files in the C:\TEMP folder
--
Henry Bartlett
Delphi Links Page:
( http://www.hotkey.net.au/~hambar/habit/delflink.htm )
.
- References:
- Dos comands
- From: didi
- Re: Dos comands
- From: didi
- Dos comands
- Prev by Date: Re: Dos comands
- Next by Date: ANN: Ledger Accounting Software
- Previous by thread: Re: Dos comands
- Next by thread: ANN: OTC Mediator - easy migration to SQL
- Index(es):