github.com/attic-labs/noms@v0.0.0-20210827224422-e5fa29d95e8b/samples/go/nomsfs/README.md (about)

     1  # nomsfs
     2  
     3  Nomsfs is a [FUSE](https://en.wikipedia.org/wiki/Filesystem_in_Userspace) filesystem built on Noms. To use it you'll need FUSE:
     4  
     5  * *Linux* -- built-in; you should be good to go
     6  * *Mac OS X* -- Install [FUSE for OS X](https://osxfuse.github.io/)
     7  
     8  Development and testing have been done exclusively on Mac OS X using FUSE for OS X.
     9  Nomsfs builds on the [Go FUSE imlementation](https://github.com/hanwen/go-fuse) from Han-Wen Nienhuys.
    10  
    11  ## Usage
    12  
    13  Make sure FUSE is installed. On Mac OS X remember to run `/Library/Filesystems/osxfuse.fs/Contents/Resources/load_osxfuse`.
    14  
    15  
    16  Build with `go build` (or just run with `go run nomsfs.go`); test with `go test`.
    17  
    18  Mount an existing or new dataset by executing `nomsfs`:
    19  
    20  ```shell
    21  $ mkdir /var/tmp/mnt
    22  $ go run nomsfs.go /var/tmp/nomsfs::fs /var/tmp/mnt
    23  running...
    24  ```
    25  
    26  Use ^C to stop `nomsfs`
    27  
    28  ### Exploring The Data
    29  
    30  1. Once you have a mount point and `nomsfs` is running you can add/delete/rename files and directories using the Finder or the command line as you would with any other file system.
    31  2. Stop `nomsfs` with ^C
    32  3. Let's look around the dataset:
    33  ```shell
    34  > noms ds /var/tmp/nomsfs
    35  fs
    36  > noms show /var/tmp/nomsfs::fs
    37  struct Commit {
    38    meta: struct {},
    39    parents: Set<Ref<Cycle<Commit>>>,
    40    value: struct Filesystem {
    41      root: struct Inode {
    42        attr: struct Attr {
    43          ctime: Number,
    44          gid: Number,
    45          mode: Number,
    46          mtime: Number,
    47          uid: Number,
    48          xattr: Map<String, Blob>,
    49        },
    50        contents: struct Directory {
    51          entries: Map<String, Cycle<1>>,
    52        } | struct Symlink {
    53          targetPath: String,
    54        } | struct File {
    55          data: Ref<Blob>,
    56        },
    57      },
    58    },
    59  }({
    60    meta:  {},
    61    parents: {
    62      d6jn389ov693oa4b9vqhe3fmn2g49c2k,
    63    },
    64    value: Filesystem {
    65      root: Inode {
    66        attr: Attr {
    67          ctime: 1.4703496225642643e+09,
    68          gid: 20,
    69          mode: 511,
    70          mtime: 1.4703496225642643e+09,
    71          uid: 501,
    72          xattr: {},
    73        },
    74        contents: Directory {
    75          entries: {
    76            "file.txt": Inode {
    77              attr: Attr {
    78                ctime: 1.470349669044128e+09,
    79                gid: 20,
    80                mode: 420,
    81                mtime: 1.465233596e+09,
    82                uid: 501,
    83                xattr: {
    84                  "com.apple.FinderInfo": 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  // 32 B
    85                  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00,
    86                },
    87              },
    88              contents: File {
    89                data: hv6f7d07uajec3mebergu810v12gem83,
    90              },
    91            },
    92            "noms_logo.png": Inode {
    93              attr: Attr {
    94                ctime: 1.4703496464136713e+09,
    95                gid: 20,
    96                mode: 420,
    97                mtime: 1.470171468e+09,
    98                uid: 501,
    99                xattr: {
   100                  "com.apple.FinderInfo": 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  // 32 B
   101                  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00,
   102                  "com.apple.quarantine": 30 30 30 32 3b 35 37 61 31 30 39 34 63 3b 50 72  // 22 B
   103                  65 76 69 65 77 3b,
   104                },
   105              },
   106              contents: File {
   107                data: higtjmhq7fo5m072vkmmldtmkn2vspkb,
   108              },
   109            },
   110  ...
   111  ```
   112  
   113  ## Limitations
   114  
   115  Hard links are not supported at this time, but may be added in the future.
   116  Mounting a dataset in multiple locations is not supported, but may be added in the future.
   117  
   118  ## Troubleshooting
   119  
   120  `Mount failed: no FUSE devices found`
   121  Make sure FUSE is installed. If you're on Mac OS X make sure the kernel module is loaded by executing `/Library/Filesystems/osxfuse.fs/Contents/Resources/load_osxfuse`.
   122  
   123  ## Contributing
   124  
   125  Issues welcome; testing welcome; code welcome. Feel free to pitch in!