static File renameFile_assertTrue(File a, File b) ctex { if (a.equals(b)) ret b; // no rename necessary if (!a.exists()) fail("Source file not found: " + f2s(a)); if (b.exists()) fail("Target file exists: " + f2s(b)); mkdirsForFile(b); ifdef renameFile_useNIO java.nio.file.Files.move(a.toPath(), b.toPath()); endifdef ifndef renameFile_useNIO if (!a.renameTo(b)) fail("Can't rename " + f2s(a) + " to " + f2s(b)); endifndef ret b; }