View Source Dagger.File (dagger v0.8.7)

A file.

Link to this section Summary

Functions

Retrieves the contents of the file.

Writes the file to a file path on the host.

Retrieves the content-addressed identifier of the file.

Gets the size of the file, in bytes.

Force evaluation in the engine.

Retrieves this file with its created/modified timestamps set to the given time.

Link to this section Types

@type t() :: %Dagger.File{client: term(), selection: term()}

Link to this section Functions

@spec contents(t()) :: {:ok, Dagger.String.t()} | {:error, term()}

Retrieves the contents of the file.

Link to this function

export(file, path, optional_args \\ [])

View Source
@spec export(t(), Dagger.String.t(), keyword()) ::
  {:ok, Dagger.Boolean.t()} | {:error, term()}

Writes the file to a file path on the host.

required-arguments

Required Arguments

  • path - Location of the written directory (e.g., "output.txt").

optional-arguments

Optional Arguments

  • allow_parent_dir_path - If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
@spec id(t()) :: {:ok, Dagger.FileID.t()} | {:error, term()}

Retrieves the content-addressed identifier of the file.

@spec size(t()) :: {:ok, Dagger.Int.t()} | {:error, term()}

Gets the size of the file, in bytes.

@spec sync(t()) :: {:ok, Dagger.FileID.t()} | {:error, term()}

Force evaluation in the engine.

Link to this function

with_timestamps(file, timestamp)

View Source
@spec with_timestamps(t(), Dagger.Int.t()) :: t()

Retrieves this file with its created/modified timestamps set to the given time.

required-arguments

Required Arguments

  • timestamp - Timestamp to set dir/files in.

Formatted in seconds following Unix epoch (e.g., 1672531199).