Contents

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

  • fm:

    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

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

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 NO.

See Also

Deprecated Methods