I've been searching for a portable method in Boost or C++17 std::filesystem (or POSIX) to determine the system sanctioned locations of the user's Documents, Downloads, and Preferences. Do these locations really need to be hard-wired, or is there a C/C++ accessible API for those locations? (portable between Windows/MacOS and ideally iOS/Android)
Asked
Active
Viewed 77 times
0
-
There's nothing in standard C++. There may be a third-party library, but library recommendations are off-topic. You might have to resort to conditional compilation based on the different operating systems you build for. – Stephen Newell May 31 '22 at 22:15
-
Historically there have been questions about Boost -- are they no longer on-topic? The STL (std::filesystem) is not a third-party library -- it's part of the language, correct? – SMGreenfield May 31 '22 at 22:17
-
Library *recommendations* are off-topic. I didn't downvote, just said it's not part of standard C++ (which includes the filesystem library). – Stephen Newell May 31 '22 at 22:19
-
There's a difference between "how do I solve Specific Problem X i'm encountering while trying to write code with Library Y" and "i'm trying to solve Problem Z, anyone know of a good library I could use for this?". The Stack Exchange policy is that the latter belongs on [Software Recommendations](https://softwarerecs.stackexchange.com/) – Nathan Pierson May 31 '22 at 22:20
-
1On my application, which runs on 6 different platforms, we have platform specific path getter function with an enum for desktop, downloads, documents, et cetera. The upshot being, my app deals with a common subset of what are offered by each of the different platforms. – Eljay May 31 '22 at 22:21
-
@StephenNewell -- is there a portion of Stack Exchange where a question about the Standard Template Library is acceptable? A quick search of "std::string" shows that there are 3,428 questions here on SO. – SMGreenfield May 31 '22 at 22:37
-
1STL questions are fine here, but you already have an answer: what you want isn't in the STL. There's no "universally supported, built-in approach". – Stephen Newell May 31 '22 at 23:10