Charles Hixson wrote (replying to himself):

Bad form, I know, but:
> f = File.stat(x)
> where x is the name of a directory returns the error:
> show tip files:
> Processing <<DocProc>>
> selectfiles.rb:31:in `stat': No such file or directory - "DocProc" 
> (Errno::ENOENT)
>         from selectfiles.rb:31:in `walk'
>         from selectfiles.rb:29:in `each'
>         from selectfiles.rb:29:in `walk'
>         from selectfiles.rb:74

I have been trying various things to detect a directory.  I am 
running ruby 1.6.4 (2001-06-04) [i386-cygwin].  This was the 
most recent version available as of Wednesday.
My computer is Win95 4.00.950 B


class Dir
   def walk (prefix = nil, &walker)
     e = self.entries
     e.delete "."; e.delete ".."
     if prefix
       e.collect! {|x| File.join(prefix, x) }
     end
			
     if block_given?
       e.each {|x|
         print "Processing <<#{x}>>  "
#       afile = File.lstat(x)
#       puts afile.inspect
#       f = File.ftype(afile)
#       puts f.inspect
#       if f.directory? then
#       if f == "directory"	then
         if  test("d?", x)
           Dir.new(x).walk x, &walker
         else
           puts "#{x} is not a directory."
         end
         yield x
       }
     end

     nil
   end
end

This version of the program runs "successfully" (i.e., without 
noticing that it has comitted errors), but it doesn't recognize 
directories.  Not shown is a version that used `ls *`, which 
also didn't descent into directories.  And `dir` wasn't 
recognized as a legitimate system command at all.  (zsh 
appearantly doesn't like it [why zsh?  my guess is because it's 
small].)