From: Hawksury Gear Date: 2010-04-04T22:06:55+09:00 Subject: Re: Reading contents of all files from a Directory > If it is only for output purposes, we can actually do it in one line: > > puts Dir["K:/test/*"].map {|f| File.read f} > > Note: this is not necessarily efficient nor safe (just think of 3GB > files...). > > Kind regards > > robert Many Thanks for replying robert, I am trying to print the contents of each file in the following way,It isn't giving me any error message but it is not showing any output, Could you please help. arr= Dir.open("K:/test").entries arr.each do| file | File.open("file","a+") do |fd| fd.each {|line| print line} end Regards, Gear -- Posted via http://www.ruby-forum.com/.