idrassi / DirHash

Windows command line utility to compute hash of directories and files
BSD 3-Clause "New" or "Revised" License
111 stars 11 forks source link

Cannot Handle Backslash on Root Drive #16

Closed comanche closed 3 years ago

comanche commented 3 years ago

Problem: Cannot handle the blackslash on the root drive as in G:\. However, it handle it normally for a root folder as in G:\a or G:\a\.

To get around this, the forward slash can be used as in G:/.

idrassi commented 3 years ago

Can you please explain the problem that you are encountering with backslash in root drive? On my side I can use D:\ for example and it works without issue.

comanche commented 3 years ago

After further investigation, I'm seeing the following:

dirhash.exe D:\ blake3
dirhash.exe "D:\dir with space" blake3

The following stops with Error: The given input file doesn't exist:

dirhash.exe "D:\" blake3
dirhash.exe "D:\dir with space\" blake3

There seems to be an issue with the trailing \". The \ must be escaping the ".

This issue is noticed in cmd.exe and not PowerShell.

idrassi commented 3 years ago

Thank you for the clarification. This is a limitation of Windows CMD which uses backslash as escape character. For example, in the case of dirhash.exe "D:\" blake3, DirHash as argument the string "D:" blake3" which of course doesn't exist as a path.

So this is not a DirHash issue and this CMD particularity must be taken into account when typing command line arguments.

comanche commented 3 years ago

Thanks for the clarification.