#include <xtd/xtd>
class program {
public:
static auto main() {
string path = R
"(c:\MyTest.txt)";
try {
string path2 =
path +
"temp";
fi2.remove();
fi1.copy_to(path2);
console::write_line(
"{0} was copied to {1}.",
path, path2);
fi2.remove();
console::write_line("{0} was successfully deleted.", path2);
console::write_line(
"The process failed: {0}",
e.to_string());
}
}
};
Defines the base class for predefined exceptions in the xtd namespace.
Definition exception.h:26
Provides static methods for the creation, copying, deletion, moving, and opening of files,...
Definition file_info.h:41
Performs operations on std::basic_string instances that contain file or directory path information....
Definition path.h:36
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.h:175
#define block_scope_(...)
The specified expression is cleared automatically when the scope is ended.
Definition block_scope.h:25
The xtd::io namespace contains types that allow reading and writing to files and data streams,...
Definition binary_reader.h:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10