copy_file Function

Copies the attributes and contents in one file and pastes them in another file.

template<class Path1, class Path2>
inline void copy_file(
   const Path1& Pval1,
   const Path2& Pval2,
   copy_option Opt = copy_option::fail_if_exists
);

Parameters

  • Pval1
    A Path object that contains the source file name. Path can be either a basic_path or a type that is derived from basic_path.

  • Pval2
    A Path object that contains the destination file name.

  • Opt
    A copy_option value that specifies function behavior if the destination file already exists. For more information, see copy_option Enumeration.

Requirements

Header: filesystem

Namespace: std::tr2::sys

See Also

Reference

<filesystem>

Other Resources

C++ Standard Library Header Files