-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 files cp command help text inaccurate #4996
Comments
I think what this is meant to mean (at least what I have found) is that it only copies from IPFS-at-large, not from disk: $ ipfs files cp /ipfs/QmV5QdWAVbYCpcEspWu4tiCtVfdL9SESidLmnXLEJ82gdL /research-stuff So if you want to copy from disk: $ ipfs add ./my-file.txt
$ ipfs files cp /ipfs/<hash from previous command> /my-file.txt The help text could still be clearer on that, though. I definitely tried to do what you’re describing the first time :P |
Ok, so the source can be IPFS-at-large or the existing mfs, but IPFS-at-large seems to win in the case where there's a matching path in your mfs: $ echo 'alive' | ipfs files write --create /dog.txt
$ ipfs files cp /dog.txt /cat.txt
$ ipfs files read /cat.txt
alive
$ ipfs files stat --hash /cat.txt
QmcDam5WmvRs3ExhQrUSYdT43iERyDdVVPkmtW5L2y64h9
$ ipfs files mkdir /ipfs
$ echo 'dead' | ipfs files write --create /ipfs/QmcDam5WmvRs3ExhQrUSYdT43iERyDdVVPkmtW5L2y64h9
$ ipfs files cp /ipfs/QmcDam5WmvRs3ExhQrUSYdT43iERyDdVVPkmtW5L2y64h9 /shroedinger.txt
$ ipfs files read /shroedinger.txt ...drumroll alive |
Yeah, I believe that’s a known issue based on comments like this: #4602 (comment) |
I had to find this issue after searching quite a lot (maybe I was just unlucky) learn how to use files api 😅 |
@nickdex, @achingbrain can you review: #7069 ? |
Fix #4996: Improve help text for "ipfs files cp"
@hsanjaun looks much better now, thank you. |
The CLI help says that
ipfs files cp
can be used to copy files into mfs:It doesn't seem to work like that though:
The text was updated successfully, but these errors were encountered: