Unable to recurisly delete folder
See original GitHub issueThe below code seems to generate a folder not empty Exception but I’m unsure why.
Would you have any idea’s for me to try.
try
{
var info = vhdbNtfs.GetDirectoryInfo("AppData\\Local");
if (info != null)
{
var dirs = info.GetDirectories();
foreach (var dir in dirs)
{
dir.Delete(true);
}
}
}
catch(Exception ex)
{
var error = ex;
}
Unable to delete non-empty directory
My understanding is that Delete(true)
should recursively delete all folders/files.
Issue Analytics
- State:
- Created 8 months ago
- Comments:7
Top Results From Across the Web
c# - Cannot delete directory with Directory.Delete(path, true)
If you are trying to recursively delete directory a and directory a\b is open in Explorer, b will be deleted but you will...
Read more >How to recursively delete directory from command line in ...
We create a new empty folder called (strangely enough!) "new folder". We then use the robocopy command, telling it the source folder is...
Read more >Unable to recursively delete directories in OneDrive ...
My current manual workaround is to delete all of the contents ( find . -type f -delete ), then synchronize, then loop deleting...
Read more >Delete a Directory Recursively in Java
Learn how to delete a directory recursively in plain Java, and by using external ... Unable to visit a file – rethrow IOException...
Read more >Ansible can't recursively delete a directory
Ansible can't recursively delete a directory ... But the directory did not get deleted. Is there any force/recursive parameter I can add? What...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I can confirm that resolves my issue but will leave this open for you to deal with 😃
Yes. That seems to work.