File
class File extends AbstractObject implements IdAble
A file.
Properties
$lastQuery | from AbstractObject |
Methods
No description
Retrieves the contents of the file.
Return the file's digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.
Writes the file to a file path on the host.
A unique identifier for this File.
Retrieves the name of the file.
Searches for content matching the given regular expression or literal string.
Retrieves the size of the file, in bytes.
Retrieves the file with content replaced with the given text.
Retrieves this file with its created/modified timestamps set to the given time.
Details
in
AbstractObject at line 13
__construct(AbstractClient $client, QueryBuilderChain $queryBuilderChain)
No description
in
AbstractObject at line 19
protected null|array|string|int|float|bool
queryLeaf(QueryBuilder $leafQueryBuilder, string $leafKey)
No description
at line 19
EnvFile
asEnvFile(bool|null $expand = null)
Parse as an env file
at line 31
File
chown(string $owner)
Change the owner of the file recursively.
at line 41
string
contents(int|null $offsetLines = null, int|null $limitLines = null)
Retrieves the contents of the file.
at line 56
string
digest(bool|null $excludeMetadata = false)
Return the file's digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.
at line 68
string
export(string $path, bool|null $allowParentDirPath = false)
Writes the file to a file path on the host.
at line 81
AbstractId
id()
A unique identifier for this File.
at line 90
string
name()
Retrieves the name of the file.
at line 101
array
search(string $pattern, bool|null $literal = false, bool|null $multiline = false, bool|null $dotall = false, bool|null $insensitive = false, bool|null $skipIgnored = false, bool|null $skipHidden = false, bool|null $filesOnly = false, int|null $limit = null, array|null $paths = null, array|null $globs = null)
Searches for content matching the given regular expression or literal string.
Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.
at line 152
int
size()
Retrieves the size of the file, in bytes.
at line 161
FileId
sync()
Force evaluation in the engine.
at line 170
File
withName(string $name)
Retrieves this file with its name set to the given name.
at line 188
File
withReplaced(string $search, string $replacement, bool|null $all = false, int|null $firstFrom = null)
Retrieves the file with content replaced with the given text.
If 'all' is true, all occurrences of the pattern will be replaced.
If 'firstAfter' is specified, only the first match starting at the specified line will be replaced.
If neither are specified, and there are multiple matches for the pattern, this will error.
If there are no matches for the pattern, this will error.
at line 209
File
withTimestamps(int $timestamp)
Retrieves this file with its created/modified timestamps set to the given time.