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

wip #18101

Closed

wip #18101

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion system/jlib/jfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4256,8 +4256,22 @@ void recursiveRemoveDirectory(IFile *dir)
recursiveRemoveDirectory(thisFile);
else
{
try
{
if (thisFile->remove())
continue;
}
catch(IException *e)
{
e->Release();
}

// is this actually useful?
// a file can still be deleted without write permissions, if the directory it's in has write permissions
// So if anything, setReadOnly(false) should be set before descending.
// But that would either involve an extra file op. or a change to the interface.
thisFile->setReadOnly(false);
thisFile->remove();
thisFile->remove(); // if gets here, should exist (ignore return false if doesn't), throws an exception if fails for other reasons
}
}
dir->remove();
Expand Down
Loading