From: Hawksury Gear Date: 2010-04-05T01:25:03+09:00 Subject: Re: Reading contents of all files from a Directory > Your error is most likely caused by the fact that Dir#entries returns > file names only, i.e. without a path. You are trying to open different > files than you think (most likely in the current directory). > > Kind regards > robert Many Thanks for replying robert, It makes sense what you have said. I think it would be a lot easier if I just explain my end goal. I think my approach is probably wrong. This is what I want to achieve, "Processing every single file that is in a particular directory" My current approach is , 1. Getting all files from a Directory using ab =Dir.open("K:/test/").entries 2. Iterating over each file that is in the directory by doing; ab.each do |f| 3. Applying "File.open" method (with required permission) to every single 'file' by doing, ab.each do |f| File.Open(f,"w+") do |readfile| 4. Finally manipulating/processing each file line by line. But what you said makes sense it looks like Dir.Open().entries doesn't return a "file object" that can be manipulated it rather returns a string (file name only). Do you have any idea how this can be addressed? Sorry to be a pain... new to Ruby! Many Thanks, -- Posted via http://www.ruby-forum.com/.