Prevent files in a folder from being moved?

On a Mac, is there a way to prevent files in a folder X from being moved by any means (by the Comd+C then Comd+Opt+V on Finder, or by mv command on the command line, or by other apps etc.) to another folder Y, but still allow files to be written/added to the folder X, and still allow files to be copied from the folder X?

If needed, please answer specific to Mac 10.11 to 10.14, and take into account both HFS+ and APFS file systems.


You can use Access Control Lists for this. Run

chmod +a "USERID:deny:delete_child" DIRECTORY

to prevent the user USERID from deleting anything from the directory. To undo, run

chmod -a "USERID:deny:delete_child" DIRECTORY

PS: If you want to have it applied to current and future subfolders beneath DIRECTORY as well, use

"USERID:deny:delete_child,directory_inherit"