filesystem¶
Cheatsheet¶
-
Convert
path::iterator
to string- Use
.string()
- Use
-
Remove trailing slash
std::filesystem::canonical()
in C++17- Erase the character before converting to path object
- Append a fake file and use
.parent_path()
1 2 3 |
|
Reference¶
parent_path() with or without trailing slash - stackoverflow https://stackoverflow.com/questions/36941934/parent-path-with-or-without-trailing-slash