Remove potentially present ZipCache files entries on DELETE-FILE and RENAME-FILE.

Corrects failing COMPILE-FILE.* ANSI-TESTs under Windows.
parent fc569d3e
......@@ -1896,6 +1896,7 @@ public class Pathname extends LispObject {
final File destination = new File(newNamestring);
if (Utilities.isPlatformWindows) {
if (destination.isFile()) {
ZipCache.remove(destination);
destination.delete();
}
}
......
......@@ -166,13 +166,11 @@ public class ZipCache {
@Override
public LispObject execute(LispObject arg) {
Pathname p = coerceToPathname(arg);
URL url = Pathname.makeURL(p);
boolean result = ZipCache.remove(url);
boolean result = ZipCache.remove(p);
return result ? T : NIL;
}
}
public static boolean remove(URL url) {
Entry entry = zipCache.get(url);
if (entry != null) {
......@@ -184,4 +182,18 @@ public class ZipCache {
}
return false;
}
}
\ No newline at end of file
public static boolean remove(Pathname p) {
URL url = Pathname.makeURL(p);
if (url == null) {
return false;
}
return ZipCache.remove(url);
}
public static boolean remove(File f) {
Pathname p = Pathname.makePathname(f);
return ZipCache.remove(p);
}
}
\ No newline at end of file
......@@ -68,6 +68,7 @@ public final class delete_file extends Primitive
return error(new FileError("Pathname has no namestring: " + defaultedPathname.writeToString(),
defaultedPathname));
final File file = new File(namestring);
ZipCache.remove(file);
if (file.exists()) {
// File exists.
for (int i = 0; i < 5; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment