Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Glob (programming)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Windows and DOS=== [[File:IBM PC DOS 1.0 screenshot.png|thumb|The [[dir (command)|{{code|dir}}]] command with a glob pattern in [[IBM PC DOS]] 1.0.]] The original [[DOS]] was a clone of [[CP/M]] designed to work on Intel's [[Intel 8088|8088]] and [[Intel 8086|8086]] processors. Windows shells, following DOS, do not traditionally perform any glob expansion in arguments passed to external programs. Shells may use an expansion for their own builtin commands: * [[Windows PowerShell]] has all the common syntax defined as stated above without any additions.<ref name="pwshcmdlet"/> * [[COMMAND.COM]] and [[cmd.exe]] have most of the common syntax with some limitations: There is no {{code|[β¦]}} and for COMMAND.COM the {{code|*}} may only appear at the end of the pattern. It can not appear in the middle of a pattern, except immediately preceding the [[filename extension]] separator dot. Windows and DOS programs receive a long command-line string instead of argv-style parameters, and it is their responsibility to perform any splitting, quoting, or glob expansion. There is technically no fixed way of describing wildcards in programs since they are free to do what they wish. Two common glob expanders include:<ref name="winWildcard"/> * The Microsoft C Runtime (msvcrt) command-line expander, which only supports {{code|?}} and {{code|*}}.<ref>{{cite web |title=Wildcard Expansion |url=https://docs.microsoft.com/en-us/cpp/cpp/wildcard-expansion |website=docs.microsoft.com |date=8 February 2022 |language=en-us}}</ref> Both [[ReactOS]] (crt/misc/getargs.c) and [[Wine (software)|Wine]] (msvcrt/data.c) contain a compatible open-source implementation of {{code|__getmainargs}}, the function operating under-the-hood, in their core CRT. * The [[Cygwin]] and MSYS {{code|dcrt0.cc}} command-line expander, which uses the unix-style {{code|glob()}} routine under-the-hood, after splitting the arguments. Most other parts of Windows, including the Indexing Service, use the MS-DOS style of wildcards found in CMD. A relic of the 8.3 filename age, this syntax pays special attention to dots in the pattern and the text (filename). Internally this is done using three extra wildcard characters, {{code|<>"}}. On the Windows API end, the {{tt|glob()}} equivalent is {{tt|FindFirstFile}}, and {{tt|fnmatch()}} corresponds to its underlying {{tt|RtlIsNameInExpression}}.<ref>[https://blogs.msdn.microsoft.com/jeremykuhne/2017/06/04/wildcards-in-windows/ Wildcards in Windows] {{Webarchive|url=https://web.archive.org/web/20191224091832/https://blogs.msdn.microsoft.com/jeremykuhne/2017/06/04/wildcards-in-windows/ |date=2019-12-24 }}. MSDN Devblog.</ref> (Another fnmatch analogue is {{tt|PathMatchSpec}}.) Both open-source msvcrt expanders use {{tt|FindFirstFile}}, so 8.3 filename quirks will also apply in them.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)