Miosa.OpenComputers.Fs (Miosa v1.0.1)

Copy Markdown View Source

Remote file system operations on registered hosts.

Summary

Functions

Delete a file or directory on the host.

Download a file as binary.

List directory entries at remote_path.

Create a directory (and all parents) on the host.

Stat a path (size, mode, is_dir, symlink, etc.).

Upload content (binary) to remote_path on the host.

Types

result()

@type result() :: {:ok, map()} | {:error, Miosa.Error.t()}

Functions

delete(client, host_id, remote_path)

@spec delete(Miosa.Client.t(), String.t(), String.t()) :: result()

Delete a file or directory on the host.

download(client, host_id, remote_path)

@spec download(Miosa.Client.t(), String.t(), String.t()) ::
  {:ok, binary()} | {:error, Miosa.Error.t()}

Download a file as binary.

list(client, host_id, remote_path)

@spec list(Miosa.Client.t(), String.t(), String.t()) :: result()

List directory entries at remote_path.

mkdir(client, host_id, remote_path)

@spec mkdir(Miosa.Client.t(), String.t(), String.t()) :: result()

Create a directory (and all parents) on the host.

stat(client, host_id, remote_path)

@spec stat(Miosa.Client.t(), String.t(), String.t()) :: result()

Stat a path (size, mode, is_dir, symlink, etc.).

upload(client, host_id, remote_path, content, filename \\ "file")

@spec upload(Miosa.Client.t(), String.t(), String.t(), binary(), String.t()) ::
  result()

Upload content (binary) to remote_path on the host.