You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
The Mutable File System (MFS) is a virtual file system on top of IPFS that exposes a Unix like API over a virtual directory. It enables users to write and read from paths without having to worry about updating the graph. It enables things like [ipfs-blob-store](https://github.com/ipfs/ipfs-blob-store) to exist.
-`options` is an optional Object that might contain the following keys:
619
+
-`hash` is a Boolean value to return only the hash.
620
+
-`size` is a Boolean value to return only the size.
621
+
622
+
`callback` must follow the `function (err, stat) {}` signature, where `err` is an Error if the operation was not successful and `stat` is an Object with the following keys:
623
+
624
+
-`hash` is a string with the hash.
625
+
-`size` is an integer with the size in Bytes.
626
+
-`cumulativeSize` is an integer with the cumulative size in Bytes.
627
+
-`blocks` is an integer indicating the number of blocks.
628
+
-`type` is a string that can be either `directory` or `file`.
629
+
630
+
If no `callback` is passed, a promise is returned.
-`options` is an optional Object that might contain the following keys:
696
+
-`offset` is an Integer with the byte offset to begin reading from.
697
+
-`count` is an Integer with the maximum number of bytes to read.
698
+
699
+
`callback` must follow the `function (err, buf) {}` signature, where `err` is an Error if the operation was not successful and `buf` is a Buffer with the contents of `path`.
700
+
701
+
If no `callback` is passed, a promise is returned.
-`path` is the path to show listing for. Defaults to `/`.
809
+
-`options` is an optional Object that might contain the following keys:
810
+
-`l` is a Boolean value o use long listing format.
811
+
812
+
`callback` must follow `function (err, files) {}` signature, where `err` is an error if the operation was not successful. `files` is an array containing Objects that contain the following keys:
813
+
814
+
-`name` which is the file's name.
815
+
-`type` which i the object's type (`directory` or `file`).
816
+
-`size` the size of the file in bytes.
817
+
-`hash` the hash of the file.
818
+
819
+
If no `callback` is passed, a promise is returned.
820
+
821
+
**Example:**
822
+
823
+
```JavaScript
824
+
ipfs.files.ls('/screenshots', function (err, files) {
0 commit comments