Forum: Ruby Directories and Files processing

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Albert L. (Guest)
on 2008-12-05 14:05
I am trying to use Shoes to iterate files in a directory and I just
cannot have it work:

        files = Dir.entries("root")
  files.each {|f|
          @data = IO.read(f)
    tokens  = tokenize(@data)
    next_token
        while not @current_token.nil?
        read_input
        next_token
        end
      @tokens = nil
      @data = nil

  }


    ##@data = IO.read("C:\\Shoes\\TxtBrx5\\root\\goo")
  ##@tokens  = tokenize(@data)
  ##next_token
    ##while not @current_token.nil?
     ##read_input
     ##next_token
    ##end
   ##@tokens = nil
   ##@data = nil

Apparently, those in comment work but iteration does not. Tried several
methods with Dir with no success.

Thanks
This topic is locked and can not be replied to.