From: Hawksury Gear Date: 2010-04-05T02:58:39+09:00 Subject: Re: Reading contents of all files from a Directory > Even better > > require 'pathname' > dir = Pathname "K:/test" > > dir.each_entry do |file| > if file.file? > file.each_line do |line| > ... > end > end > end > > Cheers > robert Many Thanks Robert, I did the following, require 'pathname' dir= Pathname "K:/test" dir.each_entry do |file| if file.file? file.each {|line| print line} ## Checking if it can access a line in a file end end It isn't giving any error message which is great but also not Displaying any Output. Probably i am not using file.each{|line| print line} correctly. Thanks, Gear -- Posted via http://www.ruby-forum.com/.