The logic of system's argument processing is supposed to make sense on Unix, with underlying OS primitives that work in the same way. But it's a mess on Windows, where the documented meaning is implemented to some degree. Point is, it takes different code paths depending on the form, with different behavior. It's been a while since I looked at it. But if it calls the CMD.exe shell with the whole thing as a string, it behaves the same way as on the command line, as I showed. If it tries to call CreateProcess directly, the exe file name is a separate argument to that."D:\Program Files\foo.exe" arg1 arg2 "file_name with spaces.txt"
I suppose I should refresh my knowledge before writing anything that makes use of that feature myself.
In reply to Re^3: quoting issue with system command
by John M. Dlugosz
in thread quoting issue with system command
by lomSpace
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |