gulrak / filesystem

An implementation of C++17 std::filesystem for C++11 /C++14/C++17/C++20 on Windows, macOS, Linux and FreeBSD.
MIT License
1.34k stars 173 forks source link

copy_file also copies permissions #144

Closed actboy168 closed 1 year ago

actboy168 commented 2 years ago

Reproduce:

    fs::path file1("temp1.txt");
    fs::path file2("temp2.txt");
    fs::permissions(file1, fs::perms::none);
    fs::permissions(file2, fs::perms::owner_write);
    fs::copy_file(file1, file2, fs::copy_options::overwrite_existing);
    assert(fs::status(file2).permissions() == fs::perms::none);
gulrak commented 1 year ago

Thank you for the PR and sorry for the delay.