4 ms·
I'm guessing every language has a module to abstract that. E.G: for python, the current go-to pypi module for this is platformdirs (https://pypi.org/project/pl
by BiteCode_dev 3y ago
I'm guessing every language has a module to abstract that.
E.G: for python, the current go-to pypi module for this is platformdirs (https://pypi.org/project/platformdirs https://pypi.org/project/platformdirs)
It's probably easier to promote the use of the module than explain the standard.
- thayne 3y agoMany of the programs complained about are written in C. I'm sure that there are libraries for c that abstract this, but there isn't one that is common enough that most c programs can depend on it.
- dwrodri 3y agoWould love to see examples for Rust, Go, NodeJS, C# and Java so that I can add them to my GitHub stars. I could find a few results for XDG support in Go, Rust, and NodeJS, but none of the aforementioned languages supported standards across all of macOS/Windows/Linux. Hopefully it's just my Google-fu failing me and people can correct me in the comments? C and C++ still have strong roll-your-own culture, with the exception that C++ now has a decent filesystem module in the standard library but still no standard config file parser AFAIK, everyone usually imports nlohmann's JSON library.
- JoshTriplett 3y agoFor Rust, use the "directories" crate: https://crates.io/crates/directories https://crates.io/crates/directories That will respect platform conventions on Windows, macOS, and Linux/UNIX.
- spixy 3y agoC#: https://chat.openai.com/share/f28ea616-1f7d-4108-9967-27eadfbe089d https://chat.openai.com/share/f28ea616-1f7d-4108-9967-27eadf...