WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Functions

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

FileItemize File Mask IntControl 91


Question:

The following script used to work:
message("FileItemize",FileItemize("\\vpa_8\b2b$\in\*.hp_to_vpa_payroll.*"))
I now returns an empty list. DOSDIR proves the files exist.

Answer:

There have been changes to how WinBatch handles File Masks. Use the function IntControl 91 to modify that behavior.

Wildcard handling has been changed for consistency, which makes multiple asterisks in the wildcard mask no longer supported by default. The idea is that it used to be broken, has been fixed, and does not work like it did before. For backwards compatibility, Intcontrol 91 is available to revert back to previous behavior. If you want the same behavior as DOS, use IntControl (91, 1, 0, 0, 0). If you want the same behavior as DOS, but without matching short versions of the file names use IntControl (91, 2, 0, 0, 0).

We're just trying to keep up with Microsoft as they change how wildcard matching works. In the 8.3 transition to the current system, wildcard matching has been redefined several times. However the worst thing was the selection of short filenames based on the long file name.

At first the short file names generated look passable ok, with names like abcdefghijklm.txt having shortnames of

abcdef~1.txt
abcdef~2.txt
and so on. However after about 10 or some files. the filename suddenly change to
AHXFGGS548SJHS447NS.txt
and other random filenames afterwards, having no relation of the original source long file name. So asking for AHX*.* would get an inexplicable hit on abcdefghijklm.txt So the mask matching was changed to use a Windows API. Not what DOS uses.

This did break some of the older mask matching programs. IntControl 91 was added to use the older algorithms, bugs and all.


Article ID:   W17409
File Created: 2008:04:10:15:09:34
Last Updated: 2008:04:10:15:09:34