B
Bary Buz
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
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