Skip to content

Read

Reads the contents of a file or directory on the remote machine.

distant fs read /path/to/file.txt

Flags

  • --depth: determines how many levels deep to traverse when printing out a directory's contents. By default this is 1, meaning to traverse the directory's children only (similar to ls).
  • --absolute: resolves relative paths when printing out a directory's contents. This does NOT traverse symlinks.
  • --canonicalize: resolves relative paths and traverses symlinks when printing out a directory's contents.
  • --include-root: includes the directory itself when printing a directory's contents.

Notes

  • Relative paths resolve to the current working directory of the server.
distant fs read --help
Reads the contents of a file or retrieves the entries within a directory on the remote machine

Usage: distant fs read [OPTIONS] <PATH>

Arguments:
  <PATH>
          The path to the file or directory on the remote machine

Options:
      --cache <CACHE>
          Location to store cached data

          [default: /home/runner/.cache/distant/cache.toml]

      --log-level <LOG_LEVEL>
          Log level to use throughout the application

          [possible values: off, error, warn, info, debug, trace]

      --connection <CONNECTION>
          Specify a connection being managed

      --log-file <LOG_FILE>
          Path to file to use for logging

      --config <CONFIG_PATH>
          Configuration file to load instead of the default paths

      --unix-socket <UNIX_SOCKET>
          Override the path to the Unix socket used by the manager (unix-only)

      --windows-pipe <WINDOWS_PIPE>
          Override the name of the local named Windows pipe used by the manager (windows-only)

      --depth <DEPTH>
          Maximum depth to traverse with 0 indicating there is no maximum depth and 1 indicating the most immediate children within the directory.

          (directory only)

          [default: 1]

      --absolute
          Whether or not to return absolute or relative paths.

          (directory only)

      --canonicalize
          Whether or not to canonicalize the resulting paths, meaning returning the canonical, absolute form of a path with all intermediate components normalized and symbolic links resolved.

          Note that the flag absolute must be true to have absolute paths returned, even if canonicalize is flagged as true.

          (directory only)

      --include-root
          Whether or not to include the root directory in the retrieved entries.

          If included, the root directory will also be a canonicalized, absolute path and will not follow any of the other flags.

          (directory only)

  -h, --help
          Print help (see a summary with '-h')