[Bug libstdc++/69259] New: std::experimental::filesystem::copy does not create symlinks for directories

puls@x-fabric.com gcc-bugzilla@gcc.gnu.org
Wed Jan 13 12:02:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69259

            Bug ID: 69259
           Summary: std::experimental::filesystem::copy does not create
                    symlinks for directories
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: puls@x-fabric.com
  Target Milestone: ---

The following test case fails when I try to soft-link the root directory to the
current directory under the name "root".

TEST_CASE("basic filesystem", "[basic]") {
    SECTION("symlink") {
        copy("/", "root", copy_options::create_symlinks);
        REQUIRE(exists("root"));
    }
}

The reason is that fs::copy(...) does not handle the case where the "from"
parameter points to a directory, but options is set to
copy_options::create_symlink.

IMO, another section needs to be added at the bottom of the function

else if (is_directory(f) && (is_set(options, copy_options::create_symlink)) {
  create_symlink(from, to, ec);
}

Thanks and regards,
  Roman


More information about the Gcc-bugs mailing list