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

dir_exists hangs up with a broken autoloop symlink #394

Open
heavywatal opened this issue Sep 18, 2022 · 2 comments
Open

dir_exists hangs up with a broken autoloop symlink #394

heavywatal opened this issue Sep 18, 2022 · 2 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@heavywatal
Copy link
Contributor

while base::dir.exists() returns FALSE quickly:

fs::link_create("autoloop", "autoloop")
base::file.exists("autoloop")
#> [1] FALSE
base::dir.exists("autoloop")
#> [1] FALSE
fs::file_exists("autoloop")
#> autoloop 
#>    FALSE
fs::link_exists("autoloop")
#> autoloop 
#>     TRUE
fs::dir_exists("autoloop")
^C
@gaborcsardi
Copy link
Member

This boils down to

file_info("autoloop", follow = TRUE)

This is what the standard Unix tools do and we could do the same.

❯ realpath autoloop
realpath: autoloop: Too many levels of symbolic links

IDK how many is too many, though.

@gaborcsardi
Copy link
Member

Based on https://man7.org/linux/man-pages/man7/path_resolution.7.html the limit is 40 for modern Linux kernels.

@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants