You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.
I'd asked this question on #284 but it's a bit of a tangent so I've moved it here.
Is there a reason we don't support URLs to indicate which kind of paths are which?
e.g. ipfs://QmPbFXUdgtyrCjExNAjugJTro6Lx4GG4MuvXTiHcZQkiif, ipfs:///a-file-in-mfs, file:///home/me/some-file.txt etc?
It would make the users' intentions clearer when trying to work out what they wanted to copy/move/add/etc, specifically in the case where they have valid MFS/filesystem paths that clash with filesystem/MFS or IPFS paths. E.g. they've got a file in MFS at /etc/passwd or on the filesystem at/ipfs/QmPbFXUdgtyrCjExNAjugJTro6Lx4GG4MuvXTiHcZQkiif.
If we detect a conflict while using regular paths we could prompt the user to re-specify their args using URLs.
Something like:
$ mkdir /ipfs
$ touch /ipfs/QmPbFXUdgtyrCjExNAjugJTro6Lx4GG4MuvXTiHcZQkiif
$ ipfs files cp /ipfs/QmPbFXUdgtyrCjExNAjugJTro6Lx4GG4MuvXTiHcZQkiif /hello.txt
Cannot copy file
A local file was detected at /ipfs/QmPbFXUdgtyrCjExNAjugJTro6Lx4GG4MuvXTiHcZQkiif
which is also an IPFS path. Please use file:// or ipfs:// URLs.
E.g.:
ipfs files cp ipfs://QmPbFXUdgtyrCjExNAjugJTro6Lx4GG4MuvXTiHcZQkiif /hello.txt
ipfs files cp file:///ipfs/QmPbFXUdgtyrCjExNAjugJTro6Lx4GG4MuvXTiHcZQkiif /hello.txt
The text was updated successfully, but these errors were encountered:
More generally, we should consider supporting all 4 flavours of IPFS address where ever a CID is currently supported.
We could implement the logic once to convert all 4 into /<namespace>/<cid>/<path> for the rest of the code to work with, and save the application layer the work of having to convert them.
I'd asked this question on #284 but it's a bit of a tangent so I've moved it here.
Is there a reason we don't support URLs to indicate which kind of paths are which?
e.g.
ipfs://QmPbFXUdgtyrCjExNAjugJTro6Lx4GG4MuvXTiHcZQkiif
,ipfs:///a-file-in-mfs
,file:///home/me/some-file.txt
etc?It would make the users' intentions clearer when trying to work out what they wanted to copy/move/add/etc, specifically in the case where they have valid MFS/filesystem paths that clash with filesystem/MFS or IPFS paths. E.g. they've got a file in MFS at
/etc/passwd
or on the filesystem at/ipfs/QmPbFXUdgtyrCjExNAjugJTro6Lx4GG4MuvXTiHcZQkiif
.If we detect a conflict while using regular paths we could prompt the user to re-specify their args using URLs.
Something like:
$ mkdir /ipfs $ touch /ipfs/QmPbFXUdgtyrCjExNAjugJTro6Lx4GG4MuvXTiHcZQkiif $ ipfs files cp /ipfs/QmPbFXUdgtyrCjExNAjugJTro6Lx4GG4MuvXTiHcZQkiif /hello.txt Cannot copy file A local file was detected at /ipfs/QmPbFXUdgtyrCjExNAjugJTro6Lx4GG4MuvXTiHcZQkiif which is also an IPFS path. Please use file:// or ipfs:// URLs. E.g.: ipfs files cp ipfs://QmPbFXUdgtyrCjExNAjugJTro6Lx4GG4MuvXTiHcZQkiif /hello.txt ipfs files cp file:///ipfs/QmPbFXUdgtyrCjExNAjugJTro6Lx4GG4MuvXTiHcZQkiif /hello.txt
The text was updated successfully, but these errors were encountered: