-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ipfs get cross platform paths #2013
Comments
So in Would it fix this if 1. https://github.com/ipfs/go-ipfs/blob/master/thirdparty/tar/extractor.go#L68 is replaced with |
The problem on Windows is that it accepts both '' and '/' as path delimiters even when mixed so it always splits the path. 1 and 2 would work but it couldn't be escaped it would have to be replaced with another symbol altogether and I'm not sure what would be appropriate or if that approach is acceptable either, a potential replacement could be a Unicode mimic such as |
As expected it doesn't like this tree either.
|
@rht thanks for that, I'm going to see if I can think of any other issues related to this and reference them there later.Another issue is dealing with case-sensitive names on systems that don't care for case. NTFS can be case sensitive but Windows does not respect it under normal conditions https://support.microsoft.com/en-us/kb/100625, I know Mac OS also offers case sensitive file systems as well as other *nix systems. Given this structure where the lower case path is 1, the mixed case is 2 and the upper case is 3
|
I don't think we should restrict paths everywhere. What happens if tomorrow we port IPFS to a system where filenames must be 8 character long max with a 3 character long extension ? Will we impose this restriction on every other IPFS user ? The correct solution is either to fail ion Windows (it is always possible to |
There was an issue on case insensitive fs in #288. |
Can someone verify if this is still an issue? |
@leerspace pointed out another problem case #3660 (comment), directories with a trailing space are not valid in Windows and cause issues when using
|
ipfs get
does not handle paths with platform specific separators in them gracefully.Consider the structure
get
ing this on a system that uses\
as a path separator results in an error. Here's an example on Windows with\
.[Note: github doesn't like this image for some reason, hosting via ipfs]
@whyrusleeping mentioned this in PR #1933 (comment) for
add
but it shouldn't be possible to add an invalid path on your platform so it was a non issue there, that's not the case forget
though.To handle this there would need to be some table of restricted symbols for various file systems/schemes/whatever, said symbols would need to be replaced with some other valid symbol. Maybe try to use the given path/name and fallback to filtering on errors like these? This would tamper with the validity of the objects you're getting, they wouldn't
add
up to the same hash but since the hash already exists and you already have it, pinning it directly should make this a non-issue.Outside of Windows restricting
\
I'm not sure what else if anything is effected.A way to workaround this is to circumvent
get
by using the gateway and external tools that do this conversion, for example using wgetwget -r http://127.0.0.1:8080/ipfs/QmSqqKkPViWCn5c6LShAqved78NtYr5okY8gN2frkNzJ9E
This will percent encode the offending slash.
Paging: @rht
The text was updated successfully, but these errors were encountered: