Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
COMMAND$ and wildcards on files
#3
Yes that's what I expected.  But it appears different:

c:\TEMP>datestamp 12-34-2022 TestDir\*.*
"12-34-2022 TestDir\a.jpg TestDir\DS1.txt TestDir\file1.jpg TestDir\file2.jpg TestDir\file3.jpg TestDir\gpsinfo.txt TestDir\hey.jpg TestDir\kladje.txt TestDir\New folder TestDir\TestFile2.jpg"
Arguments: 11


c:\TEMP>datestamp 12-34-2022 "TestDir\*.*"
"12-34-2022 TestDir\a.jpg TestDir\DS1.txt TestDir\file1.jpg TestDir\file2.jpg TestDir\file3.jpg TestDir\gpsinfo.txt TestDir\hey.jpg TestDir\kladje.txt TestDir\New folder TestDir\TestFile2.jpg"
Arguments: 11


Using full path doesn't matter:
c:\TEMP>datestamp 12-34-2022 "C:\TEMP\TestDir\*.*"
"12-34-2022 C:\TEMP\TestDir\a.jpg C:\TEMP\TestDir\DS1.txt C:\TEMP\TestDir\file1.jpg C:\TEMP\TestDir\file2.jpg C:\TEMP\TestDir\file3.jpg C:\TEMP\TestDir\gpsinfo.txt C:\TEMP\TestDir\hey.jpg C:\TEMP\TestDir\kladje.txt C:\TEMP\TestDir\New folder C:\TEMP\TestDir\TestFile2.jpg"
Arguments: 11


As you can see the argument is typed in the shell, by an user.
I also thought of escape chars and other tricks, but from a user point of view to this command line util, it should be natural, "like DOS". So better no quotes unless spaces are involved.
Actually, I was quite surprised by the parsing of the wildcard and passing many arguments.

Note that I'm switching between good old 2.0.1 and PE 3.4.1. There's no difference in behaviour, only the compile on the latter is way slower.

The code for this was straightforward:
Code: (Select All)
commands = _COMMANDCOUNT
PRINT quote$; COMMAND$; quote$
PRINT "Arguments:"; commands

Looping out all commands() obviously nicely give all generated arguments. Parsing the wildcard may be the win10 shell in action.

For some uses this is nice, just processing the separate files and done. But when subfolders and recursion are desired, things get illogical and awkward. Then I do not see I the original argument (the 'root' folder) and I cannot see if wildcards are typed by the used (by detecting *).

It wouldn't be so bad if the recurse command -R (or different) was picked up as well by the mysterious parsed whichs poops out all separate files .....
Reply


Messages In This Thread
COMMAND$ and wildcards on files - by zaadstra - 12-24-2022, 05:12 PM
RE: COMMAND$ and wildcards on files - by SMcNeill - 12-24-2022, 07:35 PM
RE: COMMAND$ and wildcards on files - by zaadstra - 12-25-2022, 12:33 AM
RE: COMMAND$ and wildcards on files - by SMcNeill - 12-25-2022, 12:48 AM
RE: COMMAND$ and wildcards on files - by mdijkens - 12-25-2022, 08:10 AM
RE: COMMAND$ and wildcards on files - by zaadstra - 12-25-2022, 04:23 PM
RE: COMMAND$ and wildcards on files - by zaadstra - 12-29-2022, 05:58 PM
RE: COMMAND$ and wildcards on files - by mdijkens - 12-30-2022, 01:01 PM
RE: COMMAND$ and wildcards on files - by mdijkens - 12-30-2022, 06:11 PM
RE: COMMAND$ and wildcards on files - by zaadstra - 01-17-2023, 10:12 PM
RE: COMMAND$ and wildcards on files - by zaadstra - 01-19-2023, 05:25 PM
RE: COMMAND$ and wildcards on files - by mdijkens - 01-19-2023, 05:59 PM
RE: COMMAND$ and wildcards on files - by zaadstra - 01-19-2023, 07:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Fullscreen command glitch 2112 2 499 10-12-2025, 04:33 PM
Last Post: 2112
  sleep command in compiler no warning doppler 3 798 01-11-2025, 02:57 PM
Last Post: SMcNeill
  Bug report Files "*.txt" - Linux version 3.11.0 Circlotron 3 886 01-25-2024, 11:35 AM
Last Post: Circlotron
  Program for editing PDF files Kernelpanic 17 2,902 11-09-2023, 12:55 AM
Last Post: James D Jarvis
  parsing code files to identify dependencies? madscijr 2 870 03-24-2023, 06:21 PM
Last Post: madscijr

Forum Jump:


Users browsing this thread: 1 Guest(s)