Instance Method

fileManager:shouldMoveItemAtPath:toPath:

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

Declaration

- (BOOL)fileManager:(NSFileManager *)fileManager shouldMoveItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath;

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

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

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:shouldMoveItemAtURL:toURL: method, which is preferred over this method in macOS 10.6 and later.

See Also

Moving an Item

- fileManager:shouldMoveItemAtURL:toURL:

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

- fileManager:shouldProceedAfterError:movingItemAtURL:toURL:

Asks the delegate if the move operation should continue after an error occurs while moving the item at the specified URL.

- fileManager:shouldProceedAfterError:movingItemAtPath:toPath:

Asks the delegate if the move operation should continue after an error occurs while moving the item at the specified path.