Permission denied when running file

Discussion in 'Ruby' started by Brad Winborg, Mar 13, 2009.

  1. Brad Winborg

    Brad Winborg Guest

    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:\Program
    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:\Program 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:\Program Files\Microsoft
    Visual Studio
    9.0\Common7\IDE\PrivateAssemblies\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program
    Files\VMware\Infrastructure\VIToolkitForWindows\Scripts;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;.py;.pyw;.tcl;.RB;.RBW

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

    --
    Posted via http://www.ruby-forum.com/.
    Brad Winborg, Mar 13, 2009
    #1
    1. Advertising

  2. Brad Winborg

    Heesob Park Guest

    Hi,

    2009/3/14 Brad Winborg <>:
    > 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
    Heesob Park, Mar 13, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris
    Replies:
    1
    Views:
    847
    Roy Johnson
    Oct 28, 2003
  2. Tina

    File access Permission Denied

    Tina, Mar 16, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    10,040
    Winista
    Mar 16, 2006
  3. Replies:
    4
    Views:
    5,871
  4. Tim Conner
    Replies:
    2
    Views:
    166
    John Joyce
    Feb 21, 2008
  5. Alexander Magidow
    Replies:
    0
    Views:
    116
    Alexander Magidow
    Apr 4, 2004
Loading...

Share This Page