Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Permission denied when running file

Reply
Thread Tools

Permission denied when running file

 
 
Brad Winborg
Guest
Posts: n/a
 
      03-13-2009
I am having a problem that I can't seem to track down the attached file
worked fine a week ago, to my knowledge nothing has changed. However now
when I try to run it I get Permission denied this happens on other files
also. I have pasted the command prompt screen, the path and PATHEXT.
Anybody have any ideas?


Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Brad>cd c:\ruby

C:\Ruby>ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]

C:\Ruby>ruby WarningErrorCount.rb
WarningErrorCount.rb:15:in `initialize': Permission denied - C:\Ruby\bin
(Errno:
:EACCES)
from WarningErrorCount.rb:15:in `open'
from WarningErrorCount.rb:15
from WarningErrorCount.rb:12:in `each'
from WarningErrorCount.rb:12

C:\Ruby>ruby.exe WarningErrorCount.rb
WarningErrorCount.rb:15:in `initialize': Permission denied - C:\Ruby\bin
(Errno:
:EACCES)
from WarningErrorCount.rb:15:in `open'
from WarningErrorCount.rb:15
from WarningErrorCount.rb:12:in `each'
from WarningErrorCount.rb:12

C:\Ruby>


Path = C:\Program Files\Liquid Technologies\Liquid XML Studio
2009\XmlDataBinder7\Redist7\cpp\win32\bin;C:\Progr am
Files\QuickTime\QTSystem\;C:\Program Files\Common Files\Roxio
Shared\DLLShared\;C:\Program Files\Microsoft SQL
Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL
Server\90\Tools\binn\;C:\Program Files\Microsoft SQL
Server\90\DTS\Binn\;C:\Program Files\Microsoft SQL
Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Progr am Files\Microsoft
Visual Studio 8\Common7\IDE\PrivateAssemblies\;C:\Program
Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft
SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft SQL
Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Prog ram Files\Microsoft
Visual Studio
9.0\Common7\IDE\PrivateAssemblies\;C:\WINDOWS\syst em32\WindowsPowerShell\v1.0;C:\Program
Files\VMware\Infrastructure\VIToolkitForWindows\Sc ripts;C:\Program
Files\Pinnacle\Studio 11;C:\Program Files\Pinnacle\Studio
11\Plugins;C:\Program Files\MySQL\MySQL Server 5.0\bin;C:\Ruby\bin

PATHEXT =
COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.p y;.pyw;.tcl;.RB;.RBW

Attachments:
http://www.ruby-forum.com/attachment...gErrorCount.rb

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Heesob Park
Guest
Posts: n/a
 
      03-13-2009
Hi,

2009/3/14 Brad Winborg <(E-Mail Removed)>:
> I am having a problem that I can't seem to track down the attached file
> worked fine a week ago, to my knowledge nothing has changed. However now
> when I try to run it I get Permission denied this happens on other files
> also. I have pasted the command prompt screen, the path and PATHEXT.
> Anybody have any ideas?
>
>
> Microsoft Windows XP [Version 5.1.2600]
> (C) Copyright 1985-2001 Microsoft Corp.
>
> C:\Documents and Settings\Brad>cd c:\ruby
>
> C:\Ruby>ruby -v
> ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]
>
> C:\Ruby>ruby WarningErrorCount.rb
> WarningErrorCount.rb:15:in `initialize': Permission denied - C:\Ruby\bin
> (Errno:
> :EACCES)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0from WarningErrorCount.rb:15:in `open'
> =C2=A0 =C2=A0 =C2=A0 =C2=A0from WarningErrorCount.rb:15
> =C2=A0 =C2=A0 =C2=A0 =C2=A0from WarningErrorCount.rb:12:in `each'
> =C2=A0 =C2=A0 =C2=A0 =C2=A0from WarningErrorCount.rb:12
>
> C:\Ruby>ruby.exe WarningErrorCount.rb
> WarningErrorCount.rb:15:in `initialize': Permission denied - C:\Ruby\bin
> (Errno:
> :EACCES)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0from WarningErrorCount.rb:15:in `open'
> =C2=A0 =C2=A0 =C2=A0 =C2=A0from WarningErrorCount.rb:15
> =C2=A0 =C2=A0 =C2=A0 =C2=A0from WarningErrorCount.rb:12:in `each'
> =C2=A0 =C2=A0 =C2=A0 =C2=A0from WarningErrorCount.rb:12
>

The error message means File.open('C:\Ruby\bin','r') failed.

To skip directory, modify line #13
unless fl =3D=3D '.' or fl =3D=3D '..' then
to
unless File.directory?(my_path + fl) then

Regards,

Park Heesob

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Permission denied when running Ruby script Tim Conner Ruby 2 02-21-2008 12:00 AM
saving file permission denied on windows zombek@gmail.com Python 4 05-16-2006 01:59 PM
File access Permission Denied Tina ASP .Net 2 03-16-2006 06:07 PM
Using parent.blank permission denied error when running files locally Alexander Magidow Javascript 0 04-04-2004 08:42 PM
Can't do setuid and file permission denied Chris Perl 1 10-28-2003 03:34 PM



Advertisments