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

removeDirectoryRec recursively follows symlink directories and should not ? #39

Closed
gst opened this issue Apr 25, 2022 · 4 comments
Closed

Comments

@gst
Copy link

gst commented Apr 25, 2022

Hi,

it looks like removeDirectoryRec follow/enter directories symlinks.. which I think should better not be by default.

the issue is that there is no option to not follow/enter directories symlink.

Could we foresee to have/add such an option flag/bool to the function signature ?

I would be happy to contribute if that would be agreed

-void removeDirectoryRec() {
+void removeDirectoryRec(bool followSymlinks=false) {

...

        if (fh.isDirectory())
        {
+          if(fh.isSymbolicLink() && !followSymlinks)
+             fh.remove();
+          else
                fh.removeDirectoryRec();
        }
@sbusch42
Copy link
Member

Looks good to me. If you create a PR, I will merge it in.

@gst
Copy link
Author

gst commented Apr 25, 2022

ok I will do that ASAP then, thanks for the answer :)

@gst
Copy link
Author

gst commented Apr 26, 2022

here it is : #40

@scheibel
Copy link
Member

scheibel commented May 4, 2022

Seems like we can close this issue. Thanks for contributing!

@scheibel scheibel closed this as completed May 4, 2022
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

3 participants