gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] fenfire/org/fenfire/util MipzipCache.java


From: Benja Fallenstein
Subject: [Gzz-commits] fenfire/org/fenfire/util MipzipCache.java
Date: Tue, 22 Apr 2003 16:22:41 -0400

CVSROOT:        /cvsroot/fenfire
Module name:    fenfire
Changes by:     Benja Fallenstein <address@hidden>      03/04/22 16:22:41

Modified files:
        org/fenfire/util: MipzipCache.java 

Log message:
        create tmpimg directory if not there

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/util/MipzipCache.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text

Patches:
Index: fenfire/org/fenfire/util/MipzipCache.java
diff -u fenfire/org/fenfire/util/MipzipCache.java:1.3 
fenfire/org/fenfire/util/MipzipCache.java:1.4
--- fenfire/org/fenfire/util/MipzipCache.java:1.3       Tue Apr 22 15:44:54 2003
+++ fenfire/org/fenfire/util/MipzipCache.java   Tue Apr 22 16:22:41 2003
@@ -20,7 +20,13 @@
 
     static int RESOLUTION = 200;
 
-    static File tmp = new File("../tmpimg");
+    static File __tmp = new File("./tmpimg");
+
+    static File tmp() {
+       if(!__tmp.exists())
+           __tmp.mkdir();
+       return __tmp;
+    }
 
     static PythonInterpreter interp;
 
@@ -54,9 +60,9 @@
        boolean exist = true;
        for(int i=0; i<n; i++) {
            String base = prefix + (i+1);
-           File f = new File(tmp, base);
+           File f = new File(tmp(), base);
            paths[i] = f.getPath();
-           tmppaths[i] = new File(tmp, "tmp"+base).getPath();
+           tmppaths[i] = new File(tmp(), "tmp"+base).getPath();
            if(!f.exists()) exist = false;
        }
        if(exist) return paths;
@@ -76,7 +82,7 @@
        BlockFile f = pages.getBlockFile();
        if(! interp.get("cv").__call__(new PyObject[] {
            new PyString(f.getFilename()),
-           new PyString(new File(tmp, "tmp"+prefix).getPath()),
+           new PyString(new File(tmp(), "tmp"+prefix).getPath()),
            new PyInteger(RESOLUTION)
        }).__nonzero__())
            throw new Error("Conversion unsuccessful");




reply via email to

[Prev in Thread] Current Thread [Next in Thread]