The man page of copyfile sates the following:
COPYFILE_CLONE [..] Note also that there is no support for cloning directories"
COPYFILE_CLONE_FORCE [...] Note also that there is no support for cloning directories: if a directory is provided as the source, an error will be returned.
Now the man page for clonefile:
> Cloning directories with these functions is strongly discouraged. Use copyfile(3) to clone directories instead.
--
So am I to enumerate the content of a directory build subfolders along the way in the target destination and clone each file inside individually? If I recall NSFileManager seems to clone a large directory instantly (edit actually I remembered wrong NSFileManager does not do this. Finder seems to copy instead of clone as well).
On further inspection, clonefile states that it can do this, but it is discouraged. Interesting. I wonder why.
If src names a directory, the directory hierarchy is cloned as if each item was cloned individually. However, the use of clonefile(2) to clone directory hierarchies is strongly discouraged. Use copyfile(3) instead for copying directories.
P.S. - Forgive me if I posting this in the wrong category, I couldn't find a "category" in the list of available categories on these forums that seems appropriate for this question.