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

user_data_dir: Consistency of ~ vs expanded version #37

Open
daattali opened this issue Mar 31, 2021 · 2 comments
Open

user_data_dir: Consistency of ~ vs expanded version #37

daattali opened this issue Mar 31, 2021 · 2 comments
Labels
feature a feature request or enhancement

Comments

@daattali
Copy link

When I run "user_data_dir("test")` on my Windows 10 machine:

C:\\User\\Dean\\AppData\\Local\\test\\test

On my MacOS 10.15 Catalina:

"/Users/dean/Library/Application Support/test"

Both of those use expanded paths for home dir.

But in the readme and in a report by a user of a package of mine, the path on Mac (which I assume was a different version) seems to be

"~/Library/Application Support/test"

There are two issues here:

  1. Consistency across OSes - it would be ideal if the function would always return the expanded version so that the end user knows what to expect
  2. More importantly, consistency within an OS - it seems not great that two different Macs produce different results
@mdsumner
Copy link

On linux I get

rappdirs::user_cache_dir()
## "~/.cache"

rappdirs::user_data_dir()
##[1] "~/.local/share"

I've been caught out by the relative tilde thing, with downstream software not expanding it (in this particular case the software created the dir in the working directory, like "./~/.cache" .

Would a PR for the full, normalized path be welcome?

@gaborcsardi
Copy link
Member

Maybe. There is value in returning a user-independent path, e.g. you can use it in a system profile. OTOH, I don't expect many people to do that, so yeah, maybe.

@gaborcsardi gaborcsardi added the feature a feature request or enhancement label Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants