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

recursive_directory_iterator for error symlink #178

Open
Layty opened this issue Jan 2, 2024 · 1 comment
Open

recursive_directory_iterator for error symlink #178

Layty opened this issue Jan 2, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@Layty
Copy link

Layty commented Jan 2, 2024

Describe the bug
I want to get a floder size, like du -s
but
in a floder, there is a error symlink file like a loop

cd /tmp
ln -sf abc abc

then use fs::recursive_directory_iterator will report

Error occurred while calculating file size: Too many levels of symbolic links: '/tmp/abc'

To Reproduce
Detailed steps to reproduce the behavior.

Expected behavior
I think we can check it is a bad file ?

@gulrak
Copy link
Owner

gulrak commented Jan 6, 2024

While it would not solve the issue of longer loops (linking a few levels up the path) detecting such self-links might be something cheap enough to make it a feature. I'll think about a solution.

@gulrak gulrak added the enhancement New feature or request label Jan 6, 2024
@gulrak gulrak self-assigned this Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants