File IO

  • Return a string representing the path to which the symbolic link points. The result may be either an absolute or relative pathname.

    Throws

    system error encountered while attempting to read the content of the link.

    Declaration

    Swift

    public func readSymbolicLink(atPath path: String) throws -> String

    Parameters

    path

    the location of the symbolic link.

    Return Value

    string reprentation of the link’s destination.

  • Create a symbolic link for file or directory at source in the location of destination.

    Throws

    system error. Example of cause includes lack of write permission at destination, lack of additional space, etc.

    Declaration

    Swift

    public func createSymbolicLink(fromPath source: String, toPath destination: String) throws

    Parameters

    source

    path to the original file or directory.

    destination

    the location for the symbolic link to be created.