Commits

Anonymous committed e06b62f

smarter free disk space test

Comments (0)

Files changed (2)

src/java/peregrine/Test.java

         log.error( "hello world: %s", new Tracepoint( new Exception( "fake exception" ) ) );
         */
 
+        System.out.printf( "%s\n", new File( "/tmp/" ).getFreeSpace() );
+        
         
     }
 

src/java/peregrine/worker/Initializer.java

         if ( config.getRequireFreeDiskSpaceSize() == -1 )
             return;
 
-        vfs.StatfsStruct struct = new vfs.StatfsStruct();
-        vfs.statfs( config.getBasedir(), struct );
-
-        long free_disk_space = struct.f_bsize * struct.f_bfree;
+        long free_disk_space = new File( config.getBasedir() ).getFreeSpace();
 
         if ( free_disk_space < config.getRequireFreeDiskSpaceSize() ) {
             throw new IOException( String.format( "Disk space too low: %s", free_disk_space ) );