Skip to content

Commit

Permalink
Merge pull request #6943 from ipfs/docs/fix-files-write-eg
Browse files Browse the repository at this point in the history
docs: fix example for files.write
  • Loading branch information
Stebalien committed Mar 2, 2020
2 parents 8d89322 + 0ddc275 commit 76acc95
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions core/commands/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -686,22 +686,23 @@ a beginning offset to write to. The entire length of the input will be
written.
If the '--create' option is specified, the file will be created if it does not
exist. Nonexistant intermediate directories will not be created.
exist. Nonexistant intermediate directories will not be created unless the
'--parents' option is specified.
Newly created files will have the same CID version and hash function of the
parent directory unless the --cid-version and --hash options are used.
parent directory unless the '--cid-version' and '--hash' options are used.
Newly created leaves will be in the legacy format (Protobuf) if the
CID version is 0, or raw is the CID version is non-zero. Use of the
--raw-leaves option will override this behavior.
CID version is 0, or raw if the CID version is non-zero. Use of the
'--raw-leaves' option will override this behavior.
If the '--flush' option is set to false, changes will not be propogated to the
merkledag root. This can make operations much faster when doing a large number
of writes to a deeper directory structure.
EXAMPLE:
echo "hello world" | ipfs files write --create /myfs/a/b/file
echo "hello world" | ipfs files write --create --parents /myfs/a/b/file
echo "hello world" | ipfs files write --truncate /myfs/a/b/file
WARNING:
Expand Down

0 comments on commit 76acc95

Please sign in to comment.