Author: toad
Date: 2007-02-07 17:26:21 +0000 (Wed, 07 Feb 2007)
New Revision: 11687

Modified:
   trunk/freenet/src/freenet/support/io/FilenameGenerator.java
Log:
Try not to get restarted in the middle of cleaning up the temp dir.
Give a little more startup feedback if lots of files to delete.

Modified: trunk/freenet/src/freenet/support/io/FilenameGenerator.java
===================================================================
--- trunk/freenet/src/freenet/support/io/FilenameGenerator.java 2007-02-07 
15:53:35 UTC (rev 11686)
+++ trunk/freenet/src/freenet/support/io/FilenameGenerator.java 2007-02-07 
17:26:21 UTC (rev 11687)
@@ -3,6 +3,8 @@
 import java.io.File;
 import java.io.IOException;

+import org.tanukisoftware.wrapper.WrapperManager;
+
 import freenet.crypt.RandomSource;
 import freenet.support.HexUtil;
 import freenet.support.Logger;
@@ -39,8 +41,12 @@
                        long wipeableFiles = 0;
                        long startWipe = System.currentTimeMillis();
                        File[] filenames = tmpDir.listFiles();
+                       WrapperManager.signalStarting(5*60*1000 + 
filenames.length);
                        if(filenames != null) {
                                for(int i=0;i<filenames.length;i++) {
+                                       if(i % 1024 == 0 && i > 0)
+                                               // User may want some feedback 
during startup
+                                               System.err.println("Deleted 
"+wipedFiles+" temp files ("+(i - wipeableFiles)+" non-temp files in temp 
dir)");
                                        File f = filenames[i];
                                        String name = f.getName();
                                        if((((File.separatorChar == '\\') && 
name.toLowerCase().startsWith(prefix.toLowerCase())) ||


Reply via email to