Show how to use xtd::io::file_info class.
#include <xtd/xtd>
class program {
public:
static auto main() {
auto path = path::get_temp_file_name();
file_info fi1(path);
sw.write_line("Hello");
sw.write_line("And");
sw.write_line("Welcome");
}
while (!sr.end_of_stream())
console::write_line(sr.read_line());
}
try {
auto path2 = path::get_temp_file_name();
file_info fi2(path2);
fi2.remove();
fi1.copy_to(path2);
console::write_line("{} was copied to {}.", path, path2);
fi2.remove();
console::write_line("{} was successfully deleted.", path2);
} catch (const system_exception& e) {
console::write_line("The process failed: {}", e.to_string());
}
}
};
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.hpp:168
#define block_scope_(...)
The specified expression is cleared automatically when the scope is ended.
Definition block_scope.hpp:25