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

RegisterAdditionalFileWatchersForSymLinkDirs fails on cyclical symlinks #17

Open
PhantomGamers opened this issue May 27, 2023 · 0 comments

Comments

@PhantomGamers
Copy link

PhantomGamers commented May 27, 2023

When there are cyclical symlinks (symlinks that contain symlinks pointing back to themselves) in a directory RegisterAdditionalFileWatchersForSymLinkDirs either hangs or throws this error:

System.IO.IOException: Too many levels of symbolic links : '/home/pgamers/.steam/steam/ubuntu12_32/bin32/bin32/bin32/bin32/bin32/bin32/bin32/bin32/bin32/bin32/bin32/bin32/bin32/bin32/ubuntu12_32/ubuntu12_32/bin32/bin32/bin32/ubuntu12_32/steam-runtime.old/amd64/usr/libexec/steam-runtime-tools-0/x86_64-linux-gnu/haswell'
   at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String, Boolean )
   at System.IO.Enumeration.FileSystemEnumerator`1.Init()
   at System.IO.Enumeration.FileSystemEnumerableFactory.DirectoryInfos(String, String, EnumerationOptions, Boolean)
   at System.IO.DirectoryInfo.InternalEnumerateInfos(String, String, SearchTarget, EnumerationOptions)
   at System.IO.DirectoryInfo.GetDirectories()
   at FileWatcherEx.Helpers.SymlinkAwareFileWatcher.RegisterAdditionalFileWatchersForSymLinkDirs(String path)
   + 28 more RegisterAdditionalFileWatchersForSymLinkDirs calls

Sometimes it fails and errors out like this, other times it runs indefinitely until the program is exited without a crash but without ever succeeding. Not sure what causes it to crash vs hang, it seems to change run to run without any changes to the environment.

I'm unsure how exactly go to about fixing this but Steam on Linux is a good application to reliably reproduce this issue with as the ~/.steam folder is chock-full of cyclical symlinks.

(Reposting from comments of #15 as #16 does not fix this issue)

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