docs: fix example for files.write
* Adds the `--parents` optiont to the first command so that it is runnable * Updates the description to specifies the option to use if you _do_ want nonexistant intermediate directories created
Alan Shaw committed
Mar 2, 2020 at 10:36 UTC
885e1125b825bbc3fe9b3d045456e0d111ebcec1
1 file changed
+5
-4
core/commands/files.go
+5
-4
@@ -686,14 +686,15 @@ a beginning offset to write to. The entire length of the input will be
686
written.
687
688
If the '--create' option is specified, the file will be created if it does not
689
-exist. Nonexistant intermediate directories will not be created.
689
+exist. Nonexistant intermediate directories will not be created unless the
690
+'--parents' option is specified.
691
692
Newly created files will have the same CID version and hash function of the
692
-parent directory unless the --cid-version and --hash options are used.
693
+parent directory unless the '--cid-version' and '--hash' options are used.
694
695
Newly created leaves will be in the legacy format (Protobuf) if the
696
CID version is 0, or raw is the CID version is non-zero. Use of the
696
---raw-leaves option will override this behavior.
697
+'--raw-leaves' option will override this behavior.
698
699
If the '--flush' option is set to false, changes will not be propogated to the
700
merkledag root. This can make operations much faster when doing a large number
@@ -701,7 +702,7 @@ of writes to a deeper directory structure.
702
703
EXAMPLE:
704
704
- echo "hello world" | ipfs files write --create /myfs/a/b/file
705
+ echo "hello world" | ipfs files write --create --parents /myfs/a/b/file
706
echo "hello world" | ipfs files write --truncate /myfs/a/b/file
707
708
WARNING: