System Attributes

  • Represents the POSIX file permission bits. These bits determines read/write/execution access to a file as well as some miscellaneous information.

    See more

    Declaration

    Swift

    public struct FilePermission : OptionSet
  • Get file permissions for path. This function will not follow symbolic links, it’ll return permissions for the link itself instead.

    Throws

    System error encountered while attempting to read permissions at the path.

    See also

    To work with Path or PathRepresentable, use PathRepresentable.permissions.

    Declaration

    Swift

    public func permissions(forPath path: String) throws -> FilePermission

    Parameters

    path

    The path for which the permissions are get.

  • Set additional permissions to existing permission at file or directories at path. This function will not follow symbolic links, it’ll change permissions for the link itself instead.

    Throws

    System error encountered while attempting to read or change permissions at the path.

    See also

    To work with Path or PathRepresentable, use PathRepresentable.add(_:).

    Declaration

    Swift

    public func add(_ permissions: FilePermission, forPath path: String) throws

    Parameters

    permissions

    Additional permissions to be set at the path.

    path

    The path whose permission is being changed.

  • Remove permissions from existing permission at a path. This function will not follow symbolic links, it’ll change permissions for the link itself instead.

    Throws

    System error encountered while attempting to read or change permissions at the path.

    See also

    To work with Path or PathRepresentable, use PathRepresentable.remove(_:).

    Declaration

    Swift

    public func remove(_ permissions: FilePermission, forPath path: String) throws

    Parameters

    permissions

    Permissions to be removed at the path.

    path

    The path whose permission is being changed.

  • Set permissions at a path. This function will not follow symbolic links, it’ll change permissions for the link itself instead.

    Throws

    System error encountered while attempting to read or change permissions at the path.

    See also

    To work with Path or PathRepresentable, use PathRepresentable.permissions.

    Declaration

    Swift

    public func set(_ permissions: FilePermission, forPath path: String) throws

    Parameters

    permissions

    Permissions to be set at the path.

    path

    The path whose permission is being changed.

  • A time interval broken down into seconds and nanoseconds.

    See more

    Declaration

    Swift

    public struct FileTime