Required Instance Methodswift-nio 2.72.0_NIOFileSystem
info(forFileAt:infoAboutSymbolicLink:)
Returns information about the file at the given path, if it exists; nil otherwise.
FileSystemProtocol.swift:141- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
func info(forFileAt path: FilePath, infoAboutSymbolicLink: Bool) async throws -> FileInfo?
Parameters
- path
The path to get information about.
- infoAboutSymbolicLink
If the file is a symbolic link and this parameter is
true
then information about the link will be returned, otherwise information about the destination of the symbolic link is returned.
Returns
Information about the file at the given path or nil
if no file exists.
Other requirements
Type members
associatedtype DirectoryFileHandle
The type of
DirectoryFileHandleProtocol
to return when opening directories.associatedtype ReadFileHandle
The type of
ReadableFileHandleProtocol
to return when opening files for reading.associatedtype ReadWriteFileHandle
The type of
ReadableAndWritableFileHandleProtocol
to return when opening files for reading and writing.associatedtype WriteFileHandle
The type of
WritableFileHandleProtocol
to return when opening files for writing.
Instance members
var currentWorkingDirectory: FilePath
Returns the current working directory.
var temporaryDirectory: FilePath
Returns the path of the temporary directory.
func copyItem(at: FilePath, to: FilePath, strategy: CopyStrategy, shouldProceedAfterError: @escaping (_ source: DirectoryEntry, _ error: Error) async throws -> Void, shouldCopyItem: @escaping (_ source: DirectoryEntry, _ destination: FilePath) async -> Bool
) async throws Copies the item at the specified path to a new location.
func createDirectory(at: FilePath, withIntermediateDirectories: Bool, permissions: FilePermissions?
) async throws Create a directory at the given path.
func createSymbolicLink(at: FilePath, withDestination: FilePath
) async throws Creates a symbolic link that points to the destination.
func createTemporaryDirectory(template: FilePath
) async throws -> FilePath Create a temporary directory at the given path, from a template.
func destinationOfSymbolicLink(at: FilePath
) async throws -> FilePath Returns the path of the item pointed to by a symbolic link.
func moveItem(at: FilePath, to: FilePath
) async throws Moves the file or directory at the specified path to a new location.
func openDirectory(atPath: FilePath, options: OpenOptions.Directory
) async throws -> DirectoryFileHandle Opens the directory at
path
and returns a handle to it.func openFile(forReadingAndWritingAt: FilePath, options: OpenOptions.Write
) async throws -> ReadWriteFileHandle Opens the file at
path
for reading and writing and returns a handle to it.func openFile(forReadingAt: FilePath, options: OpenOptions.Read
) async throws -> ReadFileHandle Opens the file at
path
for reading and returns a handle to it.func openFile(forWritingAt: FilePath, options: OpenOptions.Write
) async throws -> WriteFileHandle Opens the file at
path
for writing and returns a handle to it.func removeItem(at: FilePath, recursively: Bool
) async throws -> Int Deletes the file or directory (and its contents) at
path
.func replaceItem(at: FilePath, withItemAt: FilePath
) async throws Replaces the item at
destinationPath
with the item atexistingPath
.