File

Undocumented

  • The path to the file

    Declaration

    Swift

    var path: FilePath
  • The encoding for the text, if any, in the file.

    Declaration

    Swift

    var encoding: String.Encoding
  • The type of file or file-like item this is.

    Declaration

    Swift

    var type: FileType
  • init(open:) Default implementation

    Opens the file at ‘stringpath’.

    Default Implementation

    Opens the file at ‘stringpath’.

    Parameter

    Parameter stringpath: the path to the file.

    Throws

    FileSystemError.notFound, .isDirectory, .invalidAccess.

    Declaration

    Swift

    init(open stringpath: String) throws
  • Opens the file at ‘path’.

    Declaration

    Swift

    init(open path: FilePath) throws
  • Creates a symbolic link at ‘newlink’ pointing to the file at ‘target’.

  • Parameters:

    • newlink: The path to the new symbolic link.
    • target: The file the new link should point to.
    • ifExists: What to do if there already is something at newlink: open, throw error or replace.
  • Throws

    FileSystemError.isDirectory, .alreadyExists, .outsideSandbox, .invalidAccess.

    Declaration

    Swift

    public init<TargetFile:File>(createSymbolicLink newlink: FilePath, to target: TargetFile, ifExists: AlreadyExistsOptions) throws

    Parameters

    newlink

    The path to the new symbolic link.

    target

    The file the new link should point to.

    ifExists

    What to do if there already is something at newlink: open, throw error or replace.