Prev: Speeding up TCP
Next: A regexp?
From: Hawksury Gear on 4 Apr 2010 10:30 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/.
From: Hawksury Gear on 4 Apr 2010 11:16 Thanks for replying ,when I am doing File.open(file,"r") file without double quotes it gives an error message saying "Permission Denied Errno::EACCESS" Any idea why? -- Posted via http://www.ruby-forum.com/.
From: Hassan Schroeder on 4 Apr 2010 11:21 On Sun, Apr 4, 2010 at 8:16 AM, Hawksury Gear <blackhawk_932(a)hotmail.com> wrote: > ... it gives an error message saying > > "Permission Denied Errno::EACCESS" > > Any idea why? Is there a reason you don't think it means exactly what it says? -- Hassan Schroeder ------------------------ hassan.schroeder(a)gmail.com twitter: @hassan
From: Hawksury Gear on 4 Apr 2010 11:30 Hassan Schroeder wrote: > On Sun, Apr 4, 2010 at 8:16 AM, Hawksury Gear > <blackhawk_932(a)hotmail.com> wrote: > >> ... it gives an error message saying >> >> "Permission Denied Errno::EACCESS" >> >> Any idea why? > > Is there a reason you don't think it means exactly what it says? No doubt, the error message is self explanatory. But the actual files themselves in the directory allow Read and Write operations so they are not protected against any Read/Write operations.I have asked for the read-only permission="r" which in theory it should grant. Thanks, Gear -- Posted via http://www.ruby-forum.com/.
From: Hassan Schroeder on 4 Apr 2010 11:52
On Sun, Apr 4, 2010 at 8:30 AM, Hawksury Gear <blackhawk_932(a)hotmail.com> wrote: >>> "Permission Denied Errno::EACCESS" > No doubt, the error message is self explanatory. > But the actual files themselves in the directory allow Read and Write > operations so they are not protected against any Read/Write operations. But what about the permissions of the directory, and of the directory which contains it, etc.? Though I just realized looking at your original post that you're running Windows, which means I have no idea, so I'll shut up now :-) Good luck, -- Hassan Schroeder ------------------------ hassan.schroeder(a)gmail.com twitter: @hassan |