cpp/filesystem/copy

Copies files and directories, with a variety of options

@1@ The default, equivalent to with  used as @2@ Copies the file or directory  to file or directory, using the copy options indicated by. The behavior is undefined if there is more than one option in any of the option group present in  (even in the  group).

The behavior is as follows:
 * First, before doing anything else, obtains type and permissions of by no more than a single call to
 * std, if, , or is present in ;
 * std otherwise.


 * If necessary, obtains the status of, by no more than a single call to
 * std, if or  is present in ;
 * std otherwise (including the case where is present in ).


 * If either or  has an implementation-defined file type, the effects of this function are implementation-defined.
 * If does not exist, reports an error.
 * If and  are the same file as determined by std, reports an error
 * If either or  is not a regular file, a directory, or a symlink, as determined by std, reports an error
 * If is a directory, but  is a regular file, reports an error
 * If is a symbolic link, then
 * If is present in, does nothing.
 * Otherwise, if does not exist and  is present in, then behaves as if
 * Otherwise, reports an error


 * Otherwise, if is a regular file, then
 * If is present in, does nothing
 * Otherwise, if is present in, creates a symlink to . Note:  must be an absolute path unless  is in the current directory.
 * Otherwise, if is present in, creates a hard link to
 * Otherwise, if is a directory, then behaves as if  (creates a copy of  as a file in the directory )
 * Otherwise, behaves as if (copies the file)


 * Otherwise, if is a directory and  is set in, reports an error with an error code equal to.
 * Otherwise, if is a directory and either  has  or is ,
 * If does not exist, first executes  (creates the new directory with a copy of the old directory's attributes)
 * Then, whether already existed or was just created, iterates over the files contained in  as if by  and for each directory entry, recursively calls, where in-recursive-copy is a special bit that has no other effect when set in . (The sole purpose of setting this bit is to prevent recursive copying subdirectories if  is .)


 * Otherwise does nothing

Return value
(none)