Re: [pcre-dev] [Bug 1070] No file globbing under Win32 OS

Kezdőlap
Üzenet törlése
Szerző: Andrew Ho
Dátum:  
Címzett: PCRE Developers
Tárgy: Re: [pcre-dev] [Bug 1070] No file globbing under Win32 OS
Hello,

>Anyway is there a way to make pcregrep under Windows to populate
>wildcards in file names?


In Unix, the shell (bash, tcsh, zsh, or whatever) is the one that
expands * and ? in filenames. So if you type "foo *.txt" your shell is
turns that into "foo bar.txt baz.txt quux.txt" and that is what the foo
program sees.

In the Windows cmd.exe shell, the shell doesn't do this function, and so
if you type "foo *.txt" then foo.exe sees one argument "*.txt".

Windows does come with some globbing utility functions that should be
pretty easy to link into a program when building on Windows only:
http://msdn.microsoft.com/en-us/library/8bch7bkk.aspx

I'm not much of a Windows programmer myself, so I've never used these,
and don't know if this is the "canonical" solution.

Humbly,

Andrew

----------------------------------------------------------------------
'Twas brillig, and the slithy toves                         Andrew Ho
  Did gyre and gimble in the wabe.                  andrew@???
  All mimsy were the borogoves,
  And the mome raths outgrabe.          http://www.zeuscat.com/andrew/
----------------------------------------------------------------------