Questions tagged [std-filesystem]

2 votes
1 replies
`std::filesystem::path::operator/(/*args*/)` not working as expected
I have a class with an initialiser list in the constructor where one of the fields I'm initialising is a std::filesystem::path but it doesn't see...
asked 1 month ago
0 votes
1 replies
Get executable's path (with std::filesystem) [duplicate]
This question already has an answer here: Get path of executable 18 answers...
asked 1 month ago
1 votes
1 replies
How to avoid std::filesystem linker errors with Qt?
I would like to use the std::filesystem with Qt 5.12.0 with the g++ version Ubuntu 8.2.0-7ubuntu1, but getting linker errors: g++ -lstdc++fs -Wl...
asked 3 months ago
3 votes
1 replies
What library to link to for std::filesystem with Xcode
Xcode 10.2 now includes the <filesystem> header. However, when writing code using std::filesystem, I'm running into a lot of extra link err...
asked 4 months ago
0 votes
2 replies
is C++17 std::filesystem::recursive_directory_iterator::pop equal to boost::filesystem::recursive_directory_iterator::no_push
As the C++17 std::filesystem is very similar to the boost::filesystem, I was trying to do the same thing asked in this question: Escaping some Di...
asked 5 months ago
12 votes
1 replies
Why is it not possible to construct a `std::filesystem::path` from `std::filesystem::path` iterators?
The following piece of code aims to strip the first part of a path in case it exists: #include <filesystem> std::filesystem::path strip_p...
asked 6 months ago
1 votes
1 replies
Python bindings using pybind11 with std::filesystem as function argument giving TypeError
I have a class Foo() and class Foo() has a function with the following declaration: bool Foo::copyFile(const std::filesystem::path& src, con...
asked 1 month ago
7 votes
1 replies
Can filesystem::canonical be used to prevent filepath injection for filepaths passed to fstream
I have a public folder pub with subfolders and files in it. A user gives me now a relative filepath, I perform some mappings, and I read the file...
asked 2 months ago
1 votes
0 replies
Does C++17 (std::filesystem) provide the same error codes as Boost.Filesystem
I'm preparing code using Boost.Filesystem for (eventual) availability of std::filesystem in C++17 Xcode 10.x. Is there a cross-platform method t...
1 votes
1 replies
How does one test if a file is LOCKED and/or read-only without opening?
Is there a portable (std::filesystem) method of testing if a file is "locked" or has "read-only" permissions? MacOS Finder, for example, has a "L...
-1 votes
0 replies
Unable to test std::filesystem with GCC 9.1 [duplicate]
This question already has an answer here: Wrong GLIBCXX version when running a program that was compiled on the same ma...
asked 3 weeks ago