> String [] fileNames = new File( "/home/emschwar" ).list();
> for(int i=0; i < fileNames.length; i++) {
>   System.out.println("directory entry named [" + fileNames[i] + "]");
> }

>
> There's no real reason for it, but it focuses my mind more on the
> array (how I set it up, how I'm iterating over it) when I'm reading it
> than in the Ruby below:
>


> Dir.entries('/home/emschwar').each { |e|
>   puts "directory entry named [#{e}]"
> }

File yourFolder = new File("/home/emschwar");
for (String n : yourFolder.list()) {
    System.out.println("directory entry named [" + n + "]");
}

/// shorter:

for (String n : new File("/home/emschwar").list()) {
    System.out.println("directory entry named [" + n + "]");
}

/// shorter:
    /// using jakarta-commons-IO + Java 5 static-imports
    /// I'm always using jakarta-commons

for (String n : list("/home/emschwar")) {
    out.println("directory entry named [" + n + "]");
}


Greetings
Christoph