Hi, This may be some trace left from a old bug.
File: java/io/File.java. A long time ago, there was a bug with listInternals as it was not returning an empty array for "no files". This has been fixed since then and listInternals returns only NULL on error. If there are no files, it correctly returns a String array of length 0. The current implementation of Filelists is as follows: --------- public String[] list (FilenameFilter filter) { checkRead (); // Get the list of files String list_path = PlatformHelper.removeTailSeparator(path); File dir = new File(list_path); if (! dir.exists() || ! dir.isDirectory() ) return null; String files[] = listInternal(list_path); --> if (files == null) --> return new String[0]; if (filter == null) return files; ------------ Note: From the current implementation of listInternal, it will return NULL only on error, and it will correctly return "new String[0]" if the directory is empty. (I checked with gdb to make sure). So, I suggest something like: if (files == null) { throw new IOException("Unknown IO Exception"); } I am assuming some JCL_* functions set exceptions on errors (did not study them) but this may get other exceptional cases. Let me know if it makes sense. David --- David Bélanger Graduate Student School of Computer Science McGill University Office: MC226 Web page: http://www.cs.mcgill.ca/~dbelan2/ Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt _______________________________________________ Classpath mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/classpath