Skip to content

STRUCT

FileDescriptor

Contents

swift
public struct FileDescriptor: Equatable

File 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: AbsolutePath

Path to the file

contents

swift
public var contents: Data?

The contents of the file

state

swift
public var state: State

The 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 (.present creates a fiile, .absent deletes a file)

Parameters

NameDescription
pathPath to the file
contentsThe contents of the file (Optional)
stateThe desired state of the file (.present creates a fiile, .absent deletes a file)