Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support machine global directory #44

Open
timfish opened this issue Nov 11, 2020 · 3 comments
Open

Support machine global directory #44

timfish opened this issue Nov 11, 2020 · 3 comments
Labels
C-proposal Category: a proposal for something we might want to do, or maybe not; details still being worked out

Comments

@timfish
Copy link

timfish commented Nov 11, 2020

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:

  • Windows %PROGRAMDATA% (C:\ProgramData on Win10)
  • macOS /Library/Application Support
  • Linux $XDG_DATA_DIRS

This is currently supported by app-dirs via SharedData but the crate is unmaintained.

Would you be open to accepting a PR for this?

@tesuji
Copy link
Contributor

tesuji commented Jan 5, 2021

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:

  1. For dirs_next crate, we could either:
    a. Add an enum Location { User, Shared, System } (?), use that enum as a parameter of free functions in dirs_next. But this is a breaking change. So we need to bump major version after doing this.
    b. Add new free functions with shared_ prefix.
  2. For directories crate:
    a. Introduce a new SharedDirs struct?

Do you know if any other crates expose the same information?

@timfish
Copy link
Author

timfish commented Jan 5, 2021

@lzutao as I said above, app-dirs already exposes this as SharedData but the crate seems unmaintained.

@tesuji
Copy link
Contributor

tesuji commented Jan 5, 2021

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.

@tesuji tesuji added the C-proposal Category: a proposal for something we might want to do, or maybe not; details still being worked out label Jan 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-proposal Category: a proposal for something we might want to do, or maybe not; details still being worked out
Projects
None yet
Development

No branches or pull requests

2 participants