Discussion:
PB32.WildMatchFile
(too old to reply)
Tom
2003-06-30 22:47:04 UTC
Permalink
Does someone know whether subjected routine does return a result according
to MS-DOS rules for wildcards in filenames?

Is/are there any such rules anyhow?

For instance -a searcpattern like "n???2??" -MS-DOS's "DIR" command return a
correct result(2 items) while WildMatchFile return zero.

Thanks for considering this mesage!

Tom
Michael Mattias
2003-06-30 23:00:15 UTC
Permalink
Post by Tom
For instance -a searcpattern like "n???2??" -MS-DOS's "DIR" command return a
correct result(2 items) while WildMatchFile return zero.
Just looking at the code (header of which follows), it looks like it should
work.. but if the file has no extension I think it needs a trailing ".".

$IF 0
FILE: WMFILE.BAS
WildMatch File Function
Converted to a PB 3.2 unit 7/12/96 by Michael Mattias
Converted to PB/DOS 3.5 11/1/98
$ENDIF

$COMPILE UNIT
$LIB ALL OFF
DEFINT A-Z

'===========================================================================
=
' WildMatchFile - Match a filename against a valid DOS filespec. Returns
' true if filename matches wildcard specification.
' Courtesy Dave Navarro and Basically_Speaking (public domain)
' FileName = Name of file to check against wildcard
' WildCard = Wildcard specification to match against the file name
' Returns -1 if true, 0 if false

...

Michael Mattias
Tal Systems, Inc.
Racine WI
***@talsystems.com
----- Original Message -----
From: "Tom" <***@tom.tt>
Newsgroups: comp.lang.basic.powerbasic
Sent: Monday, June 30, 2003 5:47 PM
Subject: PB32.WildMatchFile
Post by Tom
Does someone know whether subjected routine does return a result according
to MS-DOS rules for wildcards in filenames?
Is/are there any such rules anyhow?
For instance -a searcpattern like "n???2??" -MS-DOS's "DIR" command return a
correct result(2 items) while WildMatchFile return zero.
Thanks for considering this mesage!
Tom
Loading...