STRUCT
FileDescriptor
Contents
- Properties
pathcontentsstate
- Methods
init(path:contents:state:)
swift
public struct FileDescriptor: EquatableFile Descriptor
Describes a file operation that needs to take place as part of generating a project or workspace.
- seealso:
SideEffectsDescriptor
Properties
path
swift
public var path: AbsolutePathPath to the file
contents
swift
public var contents: Data?The contents of the file
state
swift
public var state: StateThe desired state of the file (.present creates a fiile, .absent deletes a file)
Methods
init(path:contents:state:)
swift
public init(
path: AbsolutePath,
contents: Data? = nil,
state: FileDescriptor.State = .present
)Creates a File Descriptor
- Parameters:
- path: Path to the file
- contents: The contents of the file (Optional)
- state: The desired state of the file (
.presentcreates a fiile,.absentdeletes a file)
Parameters
| Name | Description |
|---|---|
| path | Path to the file |
| contents | The contents of the file (Optional) |
| state | The desired state of the file (.present creates a fiile, .absent deletes a file) |
