Instance Method

fileManager(_:shouldProceedAfterError:)

An NSFileManager object sends this message to its handler for each error it encounters when copying, moving, removing, or linking files or directories.

Declaration

func fileManager(_ fm: FileManager, shouldProceedAfterError errorInfo: [AnyHashable : Any]) -> Bool

Parameters

manager

The file manager that sent this message.

errorInfo

A dictionary that contains two or three pieces of information (all NSString objects) related to the error:

Key

Value

@"Path"

The path related to the error (usually the source path)

@"Error"

A description of the error

@"ToPath"

The destination path (not all errors)

Return Value

true if the operation (which is often continuous within a loop) should proceed, otherwise false.

Discussion

An NSFileManager object, manager, sends this message for each error it encounters when copying, moving, removing, or linking files or directories. The return value is passed back to the invoker of copyPath:toPath:handler:, movePath:toPath:handler:, removeFileAtPath:handler:, or linkPath:toPath:handler:. If an error occurs and your handler has not implemented this method, the invoking method automatically returns false.

See Also

Deprecated Methods

func changeFileAttributes([AnyHashable : Any] = [:], atPath: String)

Changes the attributes of a given file or directory.

Deprecated
func fileAttributes(atPath: String, traverseLink: Bool)

Returns a dictionary that describes the POSIX attributes of the file specified at a given.

Deprecated
func fileSystemAttributes(atPath: String)

Returns a dictionary that describes the attributes of the mounted file system on which a given path resides.

Deprecated
func directoryContents(atPath: String)

Returns the directories and files (including symbolic links) contained in a given directory.

Deprecated
func createDirectory(atPath: String, attributes: [AnyHashable : Any] = [:])

Creates a directory (without contents) at a given path with given attributes.

Deprecated
func createSymbolicLink(atPath: String, pathContent: String)

Creates a symbolic link identified by a given path that refers to a given location.

Deprecated
func pathContentOfSymbolicLink(atPath: String)

Returns the path of the directory or file that a symbolic link at a given path refers to.

Deprecated
func fileManager(FileManager, willProcessPath: String)

An NSFileManager object sends this message to a handler immediately before attempting to move, copy, rename, or delete, or before attempting to link to a given path.

Deprecated