Skip to content
This repository has been archived by the owner. It is now read-only.

how to add some file to a hash folder fast? #211

Closed
cxgreat2014 opened this issue Dec 17, 2016 · 4 comments
Closed

how to add some file to a hash folder fast? #211

cxgreat2014 opened this issue Dec 17, 2016 · 4 comments
Labels

Comments

@cxgreat2014
Copy link

cxgreat2014 commented Dec 17, 2016

I had used ipfs add -r folder_name to add a folder already, folder hash is QmNbs8stghYQMSTiC28aonneZHAk2dTJmMehJLJWR3xY7u, now I want to add some new file to this hash folder fast (not generate other file's hash), how can I do it?

@whyrusleeping
Copy link

whyrusleeping commented Dec 17, 2016

@cxgreat2014 You can use ipfs object patch.

For example, if you wanted to add a file named foo to your directory, whose hash is QmABC123, you could run:

ipfs object patch QmNbs8stghYQMSTiC28aonneZHAk2dTJmMehJLJWR3xY7u add-link foo QmABC123

@Kubuxu
Copy link

Kubuxu commented Dec 17, 2016

Or using files API:

ipfs files cp /ipfs/OLDDIRHASH /tmpdir
ipfs files cp /ipfs/NEWFILE /tmpdir/newfile
NEWHASH=$(ipfs files stat --hash /tmpdir)
ipfs pin add $NEWHASH
ipfs files rm -r /tmpdir

@cxgreat2014
Copy link
Author

cxgreat2014 commented Dec 18, 2016

@whyrusleeping @Kubuxu Thanks a lot

@flyingzumwalt
Copy link
Contributor

flyingzumwalt commented May 23, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants