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 deletion of directories #47

Open
skurrilewelt opened this issue Aug 26, 2024 · 3 comments
Open

Recursive deletion of directories #47

skurrilewelt opened this issue Aug 26, 2024 · 3 comments

Comments

@skurrilewelt
Copy link

Tried to remove a directory structure like this:

-root
--content
----file1
----file2
----subdir
------file4
------file3

and the method FtpClient::removeDir(directory) doesn't jumps in to the subdir and as a result the directory content will not be deleted as intended.

Change line 373 in mentioned class to:
$this->removeDir($fileInfo['path']);
will solve this issue. Or miss I something?

@AmraniCh
Copy link
Member

Hey, thanks for opening this issue.

print_r($this->isDir("root/content/subdir"));

Check this and see what result you will get, it must be true, otherwise we will use another method listDirDetails to see details about the file root/content/subdir and guess what the problem with it!

@skurrilewelt
Copy link
Author

I think, it is obvious. You can't call rmdir because it won't delete directories which are not empty.

@AmraniCh
Copy link
Member

AmraniCh commented Aug 30, 2024

The removeDir method should delete everything within a directory whether it's a file or a directory.

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

2 participants