By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? Disable unix-style paths interpretation of /

I fear this might be another wad, but at least there's an inconsistency: Some commands accept a unix-style path of the root directory while others do not - "dir /" just shows the current directory while "move /" works and "del /" happily eases all files in the root directory even if actually all you wanted to type is "del /?".

It would be nice to have the "/" forward slash just accept arguments, and reserve "\" for plain file paths unless it's some kind of special case like unc or ftp.
TCC isn't doing anything with those arguments; it just passes them to the appropriate Windows APIs. Some of the APIs treat a / like a \, and some don't.

Well, even in this case something is odd, esp. in comparison to cmd.exe which obviously seems to do some cooking before it passes the arguments to the api. For cmd.exe, as expected \ is a path and / is simply a broken argument (I have Unix-style paths disabled):

C:\test>del /
Invalid switch - "".

C:\test>del \
C:\*, Are you sure (Y/N)? n

C:\test>copy /
The syntax of the command is incorrect.

C:\test>copy \
1 file(s) copied.

L:\test>dir /
Invalid switch - "".

C:\test>dir \
Volume in drive L is JPSOFTFAN
Volume Serial Number is 1234-5678

Directory of C:\

With tcc, / or \ treated both as paths (del, copy), but with dir it's different as / is ignored without any warning/error message and the current directory is shown:

[L:\test]dir /

Volume in drive L is JPSOFTFAN Serial number is 1234:5678
Directory of L:\test\*

[L:\test]dir \

Volume in drive L is JPSOFTFAN Serial number is 1234:5678
Directory of L:\*

So imho either all tcc internal commands like dir should interpret / as the root directory or none, i.e. use / for options only. Btw Unix circumevents this by spec'ing / as path separators and uses - as params, which probably is a better system than Microsoft has and prevents you from doing a typo and "del /".

Similar threads