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

Cross platform common paths #48556

Open
telenieko opened this issue Mar 14, 2022 · 0 comments
Open

Cross platform common paths #48556

telenieko opened this issue Mar 14, 2022 · 0 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-io P2 A bug or feature request we're likely to work on triaged Issue has been triaged by sub team type-enhancement A request for a change that isn't a bug

Comments

@telenieko
Copy link

When working on desktop platforms it is a quite common need to get path's to certain standards that vary platform to platform, for example:

  • The user home directory, which can be retrieved from either HOME or USERPROFILE environment variables depending on the platform.
  • The application configuration path, which could be...
    • ~/.<my app> or ~/.config/<my app> on Linux
    • ~/.<my app> on macOS
    • %APPDATA%/<my app> on windows
  • Location for caches (%TEMP% on windows?, .cache/<my app>, ...)
  • Temporary files
  • Downloads folder

Right now dart provides a cross-platform solution for one of those, systemTemp but none of the others.

While the core libraries do not provide such functionality (which, being truthful, probably no language's standard library provides) there is a risk of every app finding it's own solution which may be better, worse, secure, insecure or full of bugs and unexpected corner-cases.

Knowing where an app is supposed to keeps its caches & configurations or where the user home folder lives is not only platform specific but may also vary depending on the distribution method (App Store & Microsoft Store do have specific recommendations / requirements about that).

Also, it would be risky to expect every developer to know all the appropiate paths on all platforms and stores.

Flutter team has started to walk on this direction with the xdg_directories package, though that's not cross-platform.

So, bottom line, feature request: provide a cross-platform way to retrieve Directory instances of common / standard folders. Either in core or as an official package.

References,

My current dart version is : Dart SDK version: 2.16.1 (stable) (Tue Feb 8 12:02:33 2022 +0100) on "windows_x64".

@lrhn lrhn added area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io type-enhancement A request for a change that isn't a bug labels Mar 14, 2022
@brianquinlan brianquinlan added library-io-triaged P2 A bug or feature request we're likely to work on labels Dec 14, 2022
@a-siva a-siva added triaged Issue has been triaged by sub team and removed library-io-triaged labels Dec 20, 2022
@lrhn lrhn added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. and removed area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-io P2 A bug or feature request we're likely to work on triaged Issue has been triaged by sub team type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants