Hacker News new | past | comments | ask | show | jobs | submit login

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)

It's probably easier to promote the use of the module than explain the standard.




Would 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.


For Rust, use the "directories" crate: https://crates.io/crates/directories

That will respect platform conventions on Windows, macOS, and Linux/UNIX.



Many 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.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: