In C++ is there a way to check, if we have the permission to create a file at a certain path without actually creating a file? I already read How do I create a file with boost filesystem without opening it
Here is how we can do it by creating the file, which in my case is not an optimal solution.
std::ofstream file;
file.open(path, std::ios_base::app);
if (!file.is_open()) {
WARNING("Unable to create file ");
return false;
}
file.close();
P.s. I have even tried to check permission for every file but I feel there must be a better solution to it. How to get file permissions with c++ boost library?