Win32 Dir.open() misleading error

C:\WINNT\ruby18\bin>dir
Volume in drive C is System
Volume Serial Number is 78B0-D562

Directory of C:\WINNT\ruby18\bin

[.] […] erb irb
erb.bat irb.bat msvcrt-ruby18.dll ruby.exe
rubyw.exe
7 File(s) 867,670 bytes
2 Dir(s) 2,004,111,360 bytes free

C:\WINNT\ruby18\bin>ruby -e ‘Dir.open(“erb”)’
-e:1: [BUG] rb_sys_fail() - errno == 0
ruby 1.8.0 (2003-06-16) [i386-mswin32]

abnormal program termination

C:\WINNT\ruby18\bin>

…which is quite misleading. Should be Errno::ENOTDIR.
Here is the patch (attachment).

win32.c.diff (586 Bytes)

Hello,

In message “win32 Dir.open() misleading error”

···

on Jun.17,2003 21:14:08, skywizard@time.net.my wrote:

…which is quite misleading. Should be Errno::ENOTDIR.
Here is the patch (attachment).

Thank you.
I’ll commit your patch later.

Regards,

U.Nakamura usa@osb.att.ne.jp