// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.io.*;

public class Dir {
   public static void main(String[] args) {
        // list all files in C:\
        File dir = new File("C:\\");
        String[] dirlist = dir.list();
        for(int i = 0; i < dirlist.length; i++) {
            System.out.println(dirlist[i]);
        }
        // delete C:\z.z
        System.out.println((new File("C:\\z.z")).delete());
   }
}
