From: Bary Buz Date: 2009-03-16T23:22:53+09:00 Subject: handling many files inside dir Hello, im trying to process a directory that contains many text files. I want to read each file, store the text inside file and then move to the next file. I used the following code but at the end i get an error about Permission Denied. Can someone tell me what im doing wrong. #get list of files basedir = "C:/rubyfolder" Dir.chdir(basedir) Dir.open(basedir) do |dir| dir.each do |file| x = file myfile = File.open(x, "r") x.close dataclass = Manipulate.new(myfile) end end thanks in advance -- Posted via http://www.ruby-forum.com/.