/** List all filenames in directory */ public DirEnt[] list() { File[] files = dir.listFiles(); DirEnt[] ents = new DirEnt[files.length]; for (int n = 0; n < files.length; n++) ents[n] = new DirEnt(files[n], n); return ents; }
/** Create a unix file that represents a native directory */ public NativeDirFD(NativeFileSystem fs, File dir) { if (!dir.isDirectory()) throw new RuntimeException("not a dir: " + dir); this.fs = fs; this.dir = dir; }