03-17-2023, 08:52 PM
(03-17-2023, 05:13 PM)Petr Wrote: So - of course, from the start I was counting on direntry.h to give me the filenames, that works great - but - how to get the literal mask string *.* or ?????.* and so on?
This was already discussed in another thread.
https://staging.qb64phoenix.com/showthread.php?tid=1327
It depends very much on the operating system because it intercepts * and ? offered on its command line. This could be CMD.EXE on Windows, or the Powershell equivalent, or "bash" on Linux. Nothing could be done about it. That's why pieces of text that have any * or ? are changed into at least one filename which has neither of those characters, and more likely, it is changed into many filenames.
The filenames without * and ? are received by COMMAND$(). There is no way to get them including * and ?, because MS-DOS worked this way too. If you really, really need to get them you will have to choose substitute characters, for example plus + for stars *. Then, in your program, change the plusses to stars and process it how you want. However, the moment you change to * or ? and then try to use another system call about filenames you will be sent back to what was already discussed about the operating system's filename expansion.
"glob" could be probably disabled in Linux but it's a messy affair. A search produced this:
http://unix.stackexchange.com/questions/...ddg#388697