❔ Getting cross-platform directories for storing data
Hey guys, I'm writing a CLI app with .NET 8 and I'm looking into storing config and caches on the filesystem.
I was wondering if there's some utility similar to this https://github.com/sindresorhus/env-paths#api that automatically picks the right path based on the OS and what the file is for?
GitHub
GitHub - sindresorhus/env-paths: Get paths for storing things like ...
Get paths for storing things like data, config, cache, etc - GitHub - sindresorhus/env-paths: Get paths for storing things like data, config, cache, etc
2 Replies
You bet there is.
https://learn.microsoft.com/en-us/dotnet/api/system.environment.getfolderpath?view=net-7.0
https://learn.microsoft.com/en-us/dotnet/api/system.environment.specialfolder?view=net-7.0
SpecialFolder.ApplicationData
sounds about right for youWas this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.