Required Instance Methodswift-nio 2.72.0_NIOFileSystem
setTimes(lastAccess:lastDataModification:)
Sets the file’s last access and last data modification times to the given values.
FileHandleProtocol.swift:163- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
func setTimes(lastAccess: FileInfo.Timespec?, lastDataModification: FileInfo.Timespec?) async throws
Parameters
- lastAccessTime
The new value of the file’s last access time, as time elapsed since the Epoch.
- lastDataModificationTime
The new value of the file’s last data modification time, as time elapsed since the Epoch.
Throws
If there’s an error updating the times. If this happens, the original values won’t be modified.
If either time is nil
, the current value will not be changed. If both times are nil
, then both times will be set to the current time.
Other requirements
View members
Hide members
This section is hidden by default because it contains too many (12) members.
Instance members
func addPermissions(FilePermissions
) async throws -> FilePermissions Adds permissions to the existing permissions set for the file.
func attributeNames(
) async throws -> [String] Returns an array containing the names of all extended attributes set on the file.
func close(
) async throws Closes the file handle.
func detachUnsafeFileDescriptor(
) throws -> FileDescriptor Detaches and returns the file descriptor from the handle.
func info(
) async throws -> FileInfo Returns information about the file.
func removePermissions(FilePermissions
) async throws -> FilePermissions Remove permissions from the existing permissions set for the file.
func removeValueForAttribute(String
) async throws Removes the value for the named attribute if it exists.
func replacePermissions(FilePermissions
) async throws Replaces the permissions set on the file.
func synchronize(
) async throws Synchronize modified data and metadata to a permanent storage device.
func updateValueForAttribute(some (Sendable & RandomAccessCollection<UInt8>), attribute: String
) async throws Replaces the value for the named attribute, creating it if it didn’t already exist.
func valueForAttribute(String
) async throws -> [UInt8] Returns the value for the named attribute if it exists;
nil
otherwise.func withUnsafeDescriptor<R>(@escaping (FileDescriptor) throws -> R
) async throws -> R Runs the provided callback with the file descriptor for this handle.