[Python-Dev] automatic wildcard expansion on Win32

Mark Hammond MHammond at skippinet.com.au
Sat Jun 19 02:56:42 CEST 1999


> A python-help poster finally convinced me that there was a
> way to enable
> automatic wildcard expansion on win32.  This is done by linking in
> "setargv.obj" along with all of the other MS libs.  Quick
> testing shows
> that it works.

This has existed since I have been using C on Windows.

I personally would vote against it.  AFAIK, common wisdom on Windows is to
not use this.  Indeed, if people felt that this behaviour was an
improvement, MS would have enabled it by default at some stage over the
last 10 years it has existed, and provided a way of disabling it!

This behaviour causes subtle side effects; effects Unix users are well
aware of, due to every single tool using it.  Do the tricks needed to get
the wildcard down to the program exist?  Will any windows users know what
they are?

IMO, Windows "fixed" the Unix behaviour by dropping this, and they made a
concession to die-hards by providing a rarely used way of enabling it.
Windows C programmers dont expect it, VB programmers dont expect it, even
batch file programmers dont expect it.  I dont think we should use it.

> (This is actually relevant -- it's possible that setargv.obj
> and glob.glob
> could give different answers).

Exactly.  As may win32api.FindFiles().  Give the user the wildcard, and let
them make sense of it.  The trivial case of using glob() is so simple I
dont believe it worth hiding.  Your horror story of the incorrect file
being deleted could then only be blamed on the application, not on Python!

Mark.





More information about the Python-Dev mailing list