std::filesystem::create_directory permissions differes from reality

188 Views Asked by At

At cpp reference (std::filesystem::create_directory) - we can see the follow descriptrion:

  1. Creates the directory p as if by POSIX mkdir() with a second argument of static_cast(std::filesystem::perms::all) (the parent directory must already exist). If the function fails because p resolves to an existing directory, no error is reported. Otherwise on failure an error is reported.

std::filesystem::perms::all - implies all permissions ie 777.

But when I created a directory (by std::filesystem::create_directory) in /tmp on my ubuntu 20.4 - this directory only have drwxrwxr-x (775 in numeric format)

Why this happens?

PS

I use gcc 10.3

0

There are 0 best solutions below