#include <xtd/xtd>
class program {
public:
static auto main() {
string file_name = R"(c:\test.xml)";
bool is_read_only = is_file_read_only(file_name);
console::write_line("The file read-only value for " + file_name + " is: " + is_read_only);
console::write_line("Changing the read-only value for " + file_name + " to true.");
set_file_read_access(file_name, true);
is_read_only = is_file_read_only(file_name);
console::write_line("The file read-only value for " + file_name + " is: " + is_read_only);
}
static void set_file_read_access(const string& file_name, bool set_read_only) {
f_info.is_read_only(set_read_only);
}
static bool is_file_read_only(const string& file_name) {
return f_info.is_read_only();
}
};
Provides static methods for the creation, copying, deletion, moving, and opening of files,...
Definition file_info.h:41
#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
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