rappdirs
rappdirs copied to clipboard
user_data_dir: Consistency of ~ vs expanded version
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:
- 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
- More importantly, consistency within an OS - it seems not great that two different Macs produce different results
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?
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.