我需要更改文件的权限。我试过权限功能。但我无法获得它,因为文件的安全属性不允许它。
permissions("hello_m.txt",perms::owner_all | perms::group_all, perm_options::add);
这是结果:
terminate called after throwing an instance of 'std::filesystem::\__cxx11::filesystem_error'
what(): filesystem error: cannot set permissions: Permission denied \[hello_m.txt\]