From: Hawksury Gear Date: 2010-04-04T23:30:32+09:00 Subject: Re: Reading contents of all files from a Directory Aur辿lien AMILIN wrote: > First you should use file wich contain the filename of your file instead > of > "file" which is a string > Then try to open your file with the r option not a+ (a+ means you place > the > cursor at the end of the file to append some content while r is for > reading > so the cursor is placed at the beginning of the file) so : > > File.open(file,"r") > instead of : > File.open("file","a+") > Thanks for replying , if I do File.open(file,"r") ## file without double quotes it gives an error message saying "Permission Denied Errno::EACCESS" But if I use the double qutoes i.e. File.Open("file","r") it doesn't give any error message but also doesn't show any output. Any idea why? -- Posted via http://www.ruby-forum.com/.