radisk: md5 hash file names > 255 characters #1072
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This solves the issue of radisk attempting to write to filenames with lengths exceeding the 255 character limit of most filesystems (issue here: #1070).
This is a different approach than that used in #1005 and touches only the
ename
function. If the sanitized file name would exceed the limit set by opt.maxKeyLength (and maxKeyLength is greater than 32 bytes required for the hash), I return an MD5 hash instead. The modification should also leave the browser radisk functionality untouched, to avoid compatibility issues. If this is a bad approach, or I haven't fully understood how ename works, my apologies.I do not know whether it is necessary to add the hashes to the %1C file, since the path hashes are deterministic. If this is necessary, I need guidance on how to interact with that file. I have created a Map of paths to their respective hashes for performance's sake, though it may take up too much memory over a long enough span of time.