-- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
-- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
--
class EXAMPLE01
   --
   -- The simple UNIX ls or Windows95/NT dir command using
   -- class BASIC_DIRECTORY.
   --

creation make

feature

   make is
      local
	 string: STRING;
	 i: INTEGER;
      do
	 if argument_count = 0 then
	    list_current_directory;
	 else
	    from
	       i := argument_count;
	    until
	       i = 0
	    loop
	       list_directory(argument(i));
	       i := i - 1;
	    end;
	 end;
      end;

feature {NONE}

   list_current_directory is
      do
      end;

   list_directory(path: STRING) is
      local
	 d: BASIC_DIRECTORY;
      do
	 io.put_string("Trying to list %"");
	 io.put_string(path);
	 io.put_string("%".%N");
	 !!d.make;
	 if d.set_path(path) then
	 else
	    io.put_string("d.set_path failed.%N");
	 end;
      end;

end -- EXAMPLE01
