The Finder uses some kind of rules to determine if an Item can be moved or will be copied. After dragging an Item, in certain cases Finder shows a drag-copy-cursor. Are these rules in an API available? Checked with Spotlight-Metadata, NSURL and NSFileManager: no result.
Here's what i came up with:
- if a Folder contains a ".localized" File: the folder is copied
- if a Folder is listed anywhere in a NSSearchPathDirectory
Is my assumption right? or has it to do with NSURLIsSystemImmutableKey or NSURLIsUserImmutableKey which i thought is the "Locked" flag?
Furthermore depending on various other Metadata like write-permissions and locked-flag:
ON SOURCE:
- moving a readonly file: move is possible
moving a readonly folder needs login from an admin
moving a locked file creates a copy
- moving a locked folder creates a copy
- moving a folder with a locked file inside: move is possible
moving a selection with both locked and unlocked items creates a copy
moving a dropbox writeonly folder: move is possible
writeonly files do not exist in Finder
moving a file without any permissions: move is possible (as the move rights depend on the enclosing folder)
moving a folder with a file without any permission: move is possible (as long its a move, for copy it asks for login)
if a Folder contains a ".localized" File: the folder is copied
if a Folder is listed anywhere in a NSSearchPathDirectory (home directory, ...) it is copied
if a folder contains another book: move is possible
ON TARGET:
- moving an item into a dropbox creates a copy
- moving an item into a locked folder: not possible
- moving an item into a read-only folder: asks for login