- class starlark_tugger.FileContent¶
This type represents the content of a single file.
Instances essentially track the following:
The content of a file (either a reference to a filesystem path or in-memory data).
Whether the file is executable.
The filename associated with the content. This is just the file name: directory components are not allowed.
Unfortunately, since Starlark doesn’t expose a
bytestype, we are unable to expose the raw content tracked by instances of this type.
Whether a materialized file should be marked as executable.
The filename associated with this instance.
This is just the filename.
- __init__(path: Optional[str] = None, filename: Optional[str] = None, content: Optional[str] = None, executable: Optional[bool] = None) FileContent ¶
Construct a new instance given an existing filesystem
contentmust be provided to define the content tracked by this instance.
filenamemust also be provided.
filenamemust be just a file name: no directory components are allowed.
pathis provided, it must refer to an existing filesystem path or an error will occur. Relative paths are interpreted as relative to the global
CWDvariable. Absolute paths are used as-is.
pathis provided, by default
executablewill be resolved from the given path. However, if the
executablearguments are not
None, their values will be override those derived from
contentis provided and