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

path_dir() doesn't understand path expansion with ~ well on Windows #459

Open
olivroy opened this issue Jun 13, 2024 · 0 comments
Open

path_dir() doesn't understand path expansion with ~ well on Windows #459

olivroy opened this issue Jun 13, 2024 · 0 comments

Comments

@olivroy
Copy link
Contributor

olivroy commented Jun 13, 2024

fs::path_dir("~")
#> "C:/Users/username", should be C:/Users
# using fs::path() doesn't help
fs::path_dir(fs::path("~"))
#> "C:/Users/username", should be C:/Users

A workaround is this (if you know that your file exist.

fs::path_dir(fs::path_real("~"))
#> C:/Users

Cheers

if HOME != FS_HOME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant