From da584b867923ffd89a5404625279601bfe54740e Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Fri, 7 Feb 2020 14:55:01 +0100 Subject: [PATCH 1/5] Fix #6878: Improve MFS Cli documentation --- core/commands/files.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/commands/files.go b/core/commands/files.go index e568657d644..54e89f7fb02 100644 --- a/core/commands/files.go +++ b/core/commands/files.go @@ -39,6 +39,18 @@ var FilesCmd = &cmds.Command{ Files is an API for manipulating IPFS objects as if they were a unix filesystem. +The files facility interacts with MFS (Mutable File System). MFS acts as a +single, dynamic filesystem mount. MFS has a root CID which is transparently +updated when a change happens (and can be checked with "ipfs files stat /"). + +All files and folders within MFS are respected and will not be cleaned up +during garbage collections. MFS is independent from the list of pinned items +("ipfs pin ls"). Calls to "ipfs pin add" and "ipfs pin rm" do not affect +content on MFS. Similarly, content added with "ipfs add" (which by default +pins), is not added to MFS. Any content can be put into MFS with the command +"ipfs files cp /ipfs/ /mfs/path/". + + NOTE: Most of the subcommands of 'ipfs files' accept the '--flush' flag. It defaults to true. Use caution when setting this flag to false. It will improve From 10194de133956fc342fd0cd32e4c53389467f105 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Fri, 7 Feb 2020 14:55:16 +0100 Subject: [PATCH 2/5] core/commands/files: log.Error -> flog.Error This seems like a tiny leftover. --- core/commands/files.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/commands/files.go b/core/commands/files.go index 54e89f7fb02..16ab82c3e03 100644 --- a/core/commands/files.go +++ b/core/commands/files.go @@ -774,7 +774,7 @@ stat' on the file or any of its ancestors. if retErr == nil { retErr = err } else { - log.Error("files: error closing file mfs file descriptor", err) + flog.Error("files: error closing file mfs file descriptor", err) } } }() From e05ddfab236cdf19aefe73c784d6dcfff8acff2f Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Fri, 7 Feb 2020 15:19:37 +0100 Subject: [PATCH 3/5] /mfs/path -> /some/path Co-Authored-By: Moritz <13287984+mohe2015@users.noreply.github.com> --- core/commands/files.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/commands/files.go b/core/commands/files.go index 16ab82c3e03..45777358588 100644 --- a/core/commands/files.go +++ b/core/commands/files.go @@ -48,7 +48,7 @@ during garbage collections. MFS is independent from the list of pinned items ("ipfs pin ls"). Calls to "ipfs pin add" and "ipfs pin rm" do not affect content on MFS. Similarly, content added with "ipfs add" (which by default pins), is not added to MFS. Any content can be put into MFS with the command -"ipfs files cp /ipfs/ /mfs/path/". +"ipfs files cp /ipfs/ /some/path/". NOTE: From 38ca2fbde2b8f8bb301ed64e72a3456667b783fd Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Fri, 7 Feb 2020 15:35:33 +0100 Subject: [PATCH 4/5] core/commands/files: MFS docs, minor improvements after user feedback --- core/commands/files.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/commands/files.go b/core/commands/files.go index 45777358588..b7f46649a88 100644 --- a/core/commands/files.go +++ b/core/commands/files.go @@ -45,10 +45,14 @@ updated when a change happens (and can be checked with "ipfs files stat /"). All files and folders within MFS are respected and will not be cleaned up during garbage collections. MFS is independent from the list of pinned items -("ipfs pin ls"). Calls to "ipfs pin add" and "ipfs pin rm" do not affect -content on MFS. Similarly, content added with "ipfs add" (which by default -pins), is not added to MFS. Any content can be put into MFS with the command -"ipfs files cp /ipfs/ /some/path/". +("ipfs pin ls"). Calls to "ipfs pin add" and "ipfs pin rm" will add and remove +an separate pin independent of the content on MFS. If MFS content that was +additionally pinned is removed by calling "ipfs files rm", it will still +remain pinned. + +Content added with "ipfs add" (which by default also becomes pinned), is not +added to MFS. Any content can be put into MFS with the command "ipfs files cp +/ipfs/ /some/path/". NOTE: From effbc0a542d72ee29dbb71949ca0b9bc67f75683 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 7 Feb 2020 07:27:27 -0800 Subject: [PATCH 5/5] docs(commands): fix mfs wording --- core/commands/files.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/commands/files.go b/core/commands/files.go index b7f46649a88..25f6ca8f89e 100644 --- a/core/commands/files.go +++ b/core/commands/files.go @@ -46,7 +46,7 @@ updated when a change happens (and can be checked with "ipfs files stat /"). All files and folders within MFS are respected and will not be cleaned up during garbage collections. MFS is independent from the list of pinned items ("ipfs pin ls"). Calls to "ipfs pin add" and "ipfs pin rm" will add and remove -an separate pin independent of the content on MFS. If MFS content that was +pins independently of MFS. If MFS content that was additionally pinned is removed by calling "ipfs files rm", it will still remain pinned.