I'm looking for source of globbing. because win 7 does not
change * to file names in commmandline.
So, looks like I have build one.
can anyone give me help by pointing at somewhere start with?
With apologies for being off-topic for C, here's some batch that might
help, too:
@echo off
goto :_main
:: Create an environment variable with a list of files
:: that match a globbing pattern.
::
:: Parameters:
:: 1 : The globbing pattern to be expanded
:: Returns:
:: _glob : This variable is set with the list of files
:_glob
set _glob=
for /f %%a in ('dir /a /b "%~1"') do (
call :_build_glob "%%a"
)
goto :eof
:_build_glob
if "%_glob%"=="" (
set _glob=%1
) else (
set _glob=%_glob% %1
)
goto :eof
:_main
echo.
echo Testing pattern *.bat...
echo.
call :_glob *.bat
echo _glob=%_glob%
echo.
echo Testing pattern *.t?t...
echo.
call :_glob *.t?t
echo _glob=%_glob%