Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jakesmith committed Dec 1, 2023
1 parent 637ecf2 commit 5e5f065
Showing 1 changed file with 15 additions and 1 deletion.
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

0 comments on commit 5e5f065

Please sign in to comment.