Open Layty opened 6 months ago
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
fs::recursive_directory_iterator
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 ?
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.
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
then use
fs::recursive_directory_iterator
will reportTo Reproduce Detailed steps to reproduce the behavior.
Expected behavior I think we can check it is a bad file ?