Contents

fileManager(_:shouldMoveItemAtPath:toPath:)

Asks the delegate if the file manager should move the specified item to the new path.

Declaration

optional func fileManager(_ fileManager: FileManager, shouldMoveItemAtPath srcPath: String, toPath dstPath: String) -> Bool

Parameters

  • fileManager:

    The file manager object that is attempting to move the file or directory.

  • srcPath:

    The path to the file or directory that the file manager wants to move.

  • dstPath:

    The new path for the file or directory.

Return Value

true if the operation should proceed, otherwise false. If you do not implement this method, the file manager assumes a response of true.

Discussion

This method is called only once for the item being moved, regardless of whether the item is a file, directory, or symbolic link.

This method performs the same task as the fileManager(_:shouldMoveItemAt:to:) method, which is preferred over this method in macOS 10.6 and later.

See Also

Related Documentation

Moving an Item