mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-18 10:36:44 +00:00
Fixed runtime crash on fs.delete deleting full directory not recursively
This commit is contained in:
parent
c278d997ff
commit
17056b3269
1 changed files with 5 additions and 0 deletions
|
@ -414,6 +414,11 @@ public class FileSystem : IPlugin
|
|||
var attr = File.GetAttributes(path);
|
||||
if (attr.HasFlag(FileAttributes.Directory))
|
||||
{
|
||||
if(!recursive && Directory.GetFileSystemEntries(path).Any())
|
||||
{
|
||||
L.Error("directory not empty");
|
||||
return 0;
|
||||
}
|
||||
Directory.Delete(path, recursive);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue