Heesob Park
3/13/2009 10:41:00 PM
Hi,
2009/3/14 Brad Winborg <bwinborg@rbwconsulting.net>:
> 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