Subj : Problem using JS Objects and JS Objects implementing Java Interfaces To : netscape.public.mozilla.jseng From : alvaro.diaz@roxes.com (Alvaro Diaz) Date : Wed Apr 30 2003 03:56 am I wrote a function for reading the contents of a directory recursively. But the result of calling the function (contained in variable root) is undefined. Can somebody help me out ? function Directory( path) { var directories = new Array(); var files = new Array(); var directoryFilter = new java.io.FilenameFilter() { accept:function( dir, name) { if( new java.io.File( dir, name).isDirectory()) directories.push( [name, Directory( path + "/" + name)]); else files.push( name); } } new java.io.File( path).list( directoryFilter); directories.sort(); files.sort(); return this; } var root = Directory( "."); Thanks and regards, Alvaro .