Open timfish opened 3 years ago
Thank you for opening this issue.
Would you be open to accepting a PR for this?
Yes, you're welcome. But could you talk a bit about the API you planned to add?
I have some thoughts about this:
enum Location { User, Shared, System }
(?), use that enum as a parameter of free functions in dirsnext. But this is a breaking change. So we need to bump major version after doing this.
b. Add new free functions with `shared` prefix.SharedDirs
struct?Do you know if any other crates expose the same information?
@lzutao as I said above, app-dirs
already exposes this as SharedData
but the crate seems unmaintained.
SharedData
is a variant of AppDataType
enum.
AppDataType
is used as an argument to configure the behavior of
app_dir
function and friends.
That would be option 1a I listed above. And that will need a major version bump. So I would like to hear more about what others think about this issue.
There's currently no way to get a machine global (ie. non user/home scoped) data directory. This is useful for examples if you want to download large files that can be shared between users.
This would look something like:
%PROGRAMDATA%
(C:\ProgramData
on Win10)/Library/Application Support
$XDG_DATA_DIRS
This is currently supported by
app-dirs
viaSharedData
but the crate is unmaintained.Would you be open to accepting a PR for this?