Open cheako opened 5 years ago
It would be very helpful to have something exposing the contents of XDG_DATA_DIRS
with the project suffix applied (or indeed at all).
If this includes /Applications or /Users/name/Applications on the Mac that would be super useful.
@soc Is this feature something you'd want in this crate? I might be able to dedicate some free time on this
These are all related: #87 #82 #78
The readme says this
This library is intentionally focused on providing information on user-writable directories only, as there is no discernible benefit in returning a path that points to a user-level, writable directory on one operating system, but a system-level, read-only directory on another.
i.e. it seems to explicitly exclude system directories, which is unfortunate because the name "directories" suggests it'd be all-encompasing, at least to this degree.
I'd really like a one-stop shop library I can use where I just call get_data_dir()
or whatever and get the correct directory, regardless of operating environment (system service, systemd, user).
That's some misapplied philosophy. In science, it's clear that data should lead to conclusions instead of a conclusion filtering for data, however with software it's the users/clients who write the use cases... libraries shouldn't be written with a use case in mind, that's likewise backwards.
What this library does is return one set of directories for one OS and another set of directories for others, limiting the list of directories returned based on how the data is to be used is plainly wrong.
Edit: It's like the library trying to select what project's it's included in.
Sorry, I might have misinterpreted that quote... it may be the important distinction is between writable and read-only directories and the "user" vs "system-level" thing is meant to be an example rather than criteria.
Regardless, it would be good if a maintainer could confirm a contribution in this regard would be considered, and maybe describe how the current architecture could be changed to accommodate.
Some system directories are writable /tmp
, /dev/shm
, /var/tmp
... I don't know what these would be anywhere other than on Linux, but if Windows wants my apps they have to write the compatibility layer.
Need to know if to use Program\ Files or /usr/share or /usr/games/share.