-
-
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
Windows paths with ipfs add #1922
Comments
(from outside observer...) Windows is perfectly happy to use forward On Sat, Oct 31, 2015 at 11:44 AM, Dominic Della Valle <
|
this is a golang thing-- we need to use the @wscott the golang team recommends the above for portability. i dont know that much about how all the windows systems handle paths, etc, but do know things generally improve when we find these cases and adjust them to use filepath. |
(but yeah, if windows is supposed to accept forward slashes, then who knows!) |
Windows will accept forward slashes but even when passing in a relative path with one ( Using the platform preferred delimiter internally except when producing output that depends on forward slashes seems like it would be a good way to go. I've created a pull request that fixes the malformed filenames by just changing the package import and call however there may be other places in the project that require this same change for other issues. It may be worth investigating. The same directory now produces these hashes with the same arguments When called with the full path as the argument, the full path is listed (in this case "J:\demo\ipfs\windows directory") Is this the intended behavior? |
Should be resolved with #1933. |
On Windows, when recursively adding directories with
ipfs add -r *target*
, ipfs will produce strange trees. The target directory will be walked and added but there is some redundant adding and malformed names being produced, files will have the path they are located at prepended to their filename and be listed in 2 places, the root will contain all files and directories no matter how deep in addition to having files listed (with malformed names) where they should be located, for example a file located at "C:\dir\subdir\file.ext" would live here after adding "C:\dir\subdir/C:\dir\subdir\file.ext"These visual examples should better exemplify what I mean:
These bad directories can be viewed at these hashes:
QmYtNSri8H4wstyaEwHe9gWRM1cSADCNNJBNcw3mtQuB2T
QmfPYceFpW2JNJcN8NpyncM7vT8tkasnd7pG5A6xQs7RUd
I'm assuming the problem is related to the path delimiters on Windows being '' and pkg/path or pkg/path/filepath not being used somewhere it needs to be.
There seems to be other instances where this causes issues such as when ipfs add tries to create ~/.ipfs/block if it does not exist, it will return this error:
Error: mkdir C:\Users\Dominic\.ipfs/blocks/1220bfcc: The system cannot find the path specified.
-Edit-
For reference:
OS: Windows 10 x64
Go: 1.5.1
IPFS: a93dbf6
The text was updated successfully, but these errors were encountered: