-
-
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 add -w #709
ipfs add -w #709
Conversation
Wait for #710 (and rebase on top of master once it merges) |
@@ -64,6 +65,22 @@ func AddR(n *core.IpfsNode, root string) (key string, err error) { | |||
return k.String(), nil | |||
} | |||
|
|||
// AddWrapped adds data from a reader, and wraps it with a directory object | |||
// to preserve the filename. | |||
func AddWrapped(n *core.IpfsNode, r io.Reader, filename string) (string, *merkledag.Node, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is filename the name of the directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah nevermind I see
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you document the return values?
#710 merged now. |
|
…ped directory (to preserve filename in path)
RFM |
This PR adds a
-w
or--wrap-with-directory
flag toipfs add
, so that files can have their name preserved. For example,ipfs add -w file.txt
should outputadded <hash>/file.txt file.txt
.