fs icon indicating copy to clipboard operation
fs copied to clipboard

fs::file_info hangs for symlinks of symlinks

Open DE0CH opened this issue 5 months ago • 3 comments

It seems like fs::is_file('/opt/homebrew/bin/python3') hangs on Mac with homebrew python installed. This doesn't seem to be a Mac specific bug because I was able to reproduce it by recreating the folder structure and symlinks on a linux computer I have.

Steps to reproduce

Create symlinks and folder structure with the script below

mkdir -p opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/bin
cd opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/bin
echo "#!/bin/sh
echo 'hi'
" > python3.11
chmod +x python3.11
ln -s python3.11 python3
cd ../../../../../../../../../../
mkdir -p opt/homebrew/Cellar/[email protected]/3.11.6_1/bin
cd opt/homebrew/Cellar/[email protected]/3.11.6_1/bin
ln -s ../Frameworks/Python.framework/Versions/3.11/bin/python3 python3
cd ../../../../../../
mkdir -p opt/homebrew/bin
cd opt/homebrew/bin
ln -s ../Cellar/[email protected]/3.11.6_1/bin/python3 python3
cd ../../../

And then run fs::is_file('opt/homebrew/bin/python3') to see it hangs.

Version Information

$ R --version
R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

I installed the version of fs from GitHub, which is at 8a84fc9 at the time of writing.

DE0CH avatar Jan 07 '24 11:01 DE0CH