[fs.op.copy] (original) (raw)

31 Input/output library [input.output]

31.12 File systems [filesystems]

31.12.13 Filesystem operation functions [fs.op.funcs]

31.12.13.4 Copy [fs.op.copy]

void filesystem::copy(const path& from, const path& to);

Effects: Equivalent tocopy(from, to, copy_options​::​none).

void filesystem::copy(const path& from, const path& to, error_code& ec);

Effects: Equivalent tocopy(from, to, copy_options​::​none, ec).

void filesystem::copy(const path& from, const path& to, copy_options options);void filesystem::copy(const path& from, const path& to, copy_options options, error_code& ec);

Preconditions: At most one element from each option group ([fs.enum.copy.opts]) is set in options.

Effects: Before the first use of f and t:

Effects are then as follows:

Remarks: For the signature with argument ec, any library functions called by the implementation shall have an error_code argument if applicable.

[Example 1:

Given this directory structure:

/dir1 file1 file2 dir2 file3

Calling copy("/dir1", "/dir3") would result in:

/dir1 file1 file2 dir2 file3 /dir3 file1 file2

Alternatively, calling copy("/dir1", "/dir3", copy_options​::​recursive) would result in:

/dir1 file1 file2 dir2 file3 /dir3 file1 file2 dir2 file3

— _end example_]