4 ms·
> drop \ for / API calls accept / as path separator (and interpret it correctly). Shell is a different beast though.
by zvrba 5y ago
> drop \ for /
API calls accept / as path separator (and interpret it correctly). Shell is a different beast though.
- tcfhgj 5y agoI just tested in PS and found that it eat's / as well
- deleted 5y ago[deleted]
- vbezhenar 5y agocmd accepts /, but you need to enclose path into quotes, otherwise it tries to interpret it as an option switch. So you would also need to rewrite all command line utilities to use something like `ipconfig --all` instead of `ipconfig /all`.
- zvrba 5y agoAh, quoting in cmd is its own kind of hell. Not so fun fact and actually the only part of Windows APIs that I truly hate (and I've worked with many of them): command-line arguments are passed to the program as a single flat string. Splitting into the argc,argv array is left to the CRT startup code.
- pjmlp 5y agoThat comes from compatibility with MS-DOS ways of dealing with arguments.