Dec 242017
 
TSR that enables UNIX-style filename wildcards. Doesn't work with all commands (particularly internal commands).
File WILD.ZIP from The Programmer’s Corner in
Category File Managers
TSR that enables UNIX-style filename wildcards. Doesn’t work with all commands (particularly internal commands).
File Name File Size Zip Size Zip Type
WILDUNIX.COM 2190 1317 deflated
WILDUNIX.DOC 4633 2172 deflated

Download File WILD.ZIP Here

Contents of the WILDUNIX.DOC file


WILDUNIX.COM (Version 1.5) - UN*X STYLE PATTERN MATCHER
-----------------------------------------


Wildunix is a TSR which intercepts INT 21 functions 4E and 4F, the DOS
'Find First' and 'Find Next' pattern matching routines. It implements a
UN*X style pattern matching algorithm instead of DOS's.

There are no command-line arguments: to run, just type 'wildunix'.
As with most TSR utilities, it's best to have it loaded by the
'autoexec.bat' file.

'Wildunix' will resist attempts to load multiple copies of itself.

The parameters to the modified functions (and returned values) are intended
to match the original *documented* specification as nearly as possible. Due
to some inconsistency around DOS version 3.1 concerning the contents of the
'undocumented' part of the info returned in the DTA, 'Wildunix' will only
run on DOS 3.20 and above. Applications that make use of the *undocumented*
part of the DTA will likely crash if 'Wildunix' is running.

Accepted wildcards:
*Matches any string (including none)
?Matches any single character
[list]Matches any character that satisfies the items in the list
The list may consist of:
1) Single charactersor
2) Two characters separated by a minus sign, meaning 'match
a character whose ASCII value lies between the two limits'.

Differences between UN*X's pattern-matching and this TSR's version:
1) The pattern given may not contain more than 15 characters.
2) The patterns '*' and '*.*' do the same thing (special case). This is because
many MSDOS utilities search a directory by specifying '*.*'. Strict
UN*X pattern matching would only find filenames with a dot in them, but
as that would break some MSDOS routines, it's been kludged. If you
really want to match only files with '.' in them, try '*[.]*'
3) A wild-pattern passed to a utility on the command-line may fail strangely
if the ONLY wildcards used are '[' and ']'. This is not the fault of
'Wildunix', it's because many DOS utilities choose whether or not to
call functions 4E and 4F depending on whether *they* think you've
used wildcards or not. Needless to say, no test is made for '[' and ']'.
You can get round this by putting a spurious '*' at the end of the
pattern (it will match the null string and have no effect other than
to force the utility to call functions 4E and 4F).

-------------------------------------------------------



Changes to the specification of INT 21, Functions 4E and 4F.

The first 12 bytes of the 'undocumented' area of the DTA will not be as
you expect. They will contain a 'packed' wildcard string which will be
unpacked and used by the next call to 'Find Next'. This was neccessary in order
to allow 15-characters in wildcard specifications. With the advent of the
"[]" construction, 11 (as used in MSDOS) was insufficient.

The packing algorithm maps those ASCII chars legal in filenames to a 6-bit
representation, then packs 16 6-bit numbers into 12 bytes. In DOS format, byte
0 of the undocumented area is the drive-no for the search, this is truncated
to 6-bits, and becomes the 16th packed character. (That's why there's only
space for 15 chars of pattern).

The mapping of ASCII to 6-bit is as follows:
Ascii NULL-> $00
Ascii '!' thru '9'-> $01 thru $19
Ascii '\'-> $1A
Ascii '{' thru '~'-> $1B thru $1E
Ascii '?' thru '_'-> $1F thru $3F
Ascii 'a' thru 'z'-> $21 thru $3A(ucase & lcase map the same)

--------------------------------------------------

Under consideration:
1)Arranging to intercept functions 11H, 12H and 29H - the FCB orientated
wildcard matcher routines. (Thanks to Russ Nelson for the idea). This
*may* make DIR and some other old-fashioned Microsoft utilities take
UN*X wild cards properly.

2)Arranging for the command 'wildunix -f' to switch off the TSR, and
for 'wildunix -n' to switch it back on again, so that utilities which
object to 'wildunix' can run without trouble. BACKUP and/or RESTORE
seem to be examples of this problem.

(c) Steve Hosgood & Terry Barnaby 1989.
Permission is granted for noncommercial use of this documentation and the
associated software. No guarantees are given or to be implied. If the program
works, that's fine, if not, chuck it.

This documentation and associated software may be freely copied within the
noncommercial domain as long as no charge is made and the copyright notices
remain intact.

The authors will accept no liability for death, injury, lost Mars probes or
anything else.

Enquiries, comments, donations (!) etc to: [email protected]


 December 24, 2017  Add comments

Leave a Reply