Directories and Files processing

A

Albert Lao-an

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
 
A

Aldric Giacomoni

Is it an option to do something like this?
Dir.chdir("root")
Dir.glob('*') do |f|
(enter stuff here)
end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top