import java.io.*;

/**
 * A simplifed version of the dir command in MS-Windows/DOS and
 * the ls command in Unix/Linux
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public class DirectoryListing
{
    /**
     * The entry point
     *
     * @param args   The command line arguments
     */
    public static void main(String[] args)
    {
       File        current;
       File[]      list;
       

       current = new File(".");
       list    = current.listFiles();

       System.out.println("\nDirectory of " + current.getAbsolutePath()+"\n");
       for (int i=0; i<list.length; i++)
       {
          System.out.print(list[i].getName() + "\t" + list[i].length());

          if (list[i].isDirectory()) System.out.println("(Directory)");
          else                       System.out.println();
       }
    }
}
