RHash icon indicating copy to clipboard operation
RHash copied to clipboard

Cannot read files with backslashes in their names

Open systwi-again opened this issue 3 years ago • 1 comments

The title basically says it all.

$ rhash --simple 'foo\bar'
RHash: foo/bar: No such file or directory

rhash (version 1.4.2) wants to interpret backslashes as forward slashes, which makes sense on Windows systems where the two can usually be used synonymously without issue. I'm using Arch (btw), where backslashes are permitted in filenames.

My theorized solution is to add a switch to rhash that disables this feature and treats \ and / as their own characters (backslash and path delimiter) both when writing and reading hash files (output). Maybe even using backslash escapes for offending characters, like GNU coreutils' md5sum, would be a nice workaround.

I would very much appreciate if this bug could be rectified.

Best regards.

systwi-again avatar Mar 24 '22 03:03 systwi-again

This issue should be solved by implementing the feature #97, that means:

using backslash escapes for offending characters, like GNU coreutils' md5sum

I'll quote a related comment from #97:

There exists a related problem with filenames containing backslash, since when RHash finds a backslash in a hash file it decides that hash file is generated on Windows and treats backslash as a path separator.

rhash avatar Jun 13 '22 10:06 rhash