Skip to content

Commit

Permalink
Handle deleting symlinks differently on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroSteiner committed Nov 6, 2024
1 parent 64631d2 commit af89b27
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
public class stdapi_fs_delete_dir_V1_7 extends stdapi_fs_delete_dir {
@Override
protected boolean deleteSymlink(File file) throws IOException {
Files.delete(file.toPath());
return true;
String osName = System.getProperty("os.name");
if (osName != null && osName.toLowerCase().contains("windows")) {
Files.delete(file.toPath());
return true;
}
return file.delete();
}
}

0 comments on commit af89b27

Please sign in to comment.