[Bug:trunk] IO behaviors on mingw

akr e$B$5$se(B
e$B1sF#$G$9!#e(B

e$B0J2<$N$h$&$K!“e(BIO e$B$K4X$7$Fe(B Linux e$B$He(B mingw
e$B$G5sF0$,0c$$$^$9!#e(B
e$B$=$l$>$l;EMM$G$7$g$&$+!”%P%0$G$7$g$&$+!#e(B

  1. $ ./ruby -e ‘f = File.open(“foo”, “w”); IO.for_fd(f.fileno, “r”)’
    linux: EINVAL
    mingw: [email protected]$o$J$$e(B (gets e$B$7$?$ie(B EBADF)
    e$B;29Me(B: http://redmine.ruby-lang.org/issues/show/1582

  2. $ ./ruby -e ‘f1 = File.open(“foo”, “w”); f2 = IO.new(f1.fileno); p
    f2.gets’
    linux: IOError
    mingw: EBADF

  3. $ rm foo && touch foo && ./ruby -e ‘f = File.open(“foo”); p f.eof?;
    p f.getc; f.ungetc(100); p f.eof?; p f.getc’
    linux: true, nil, false, “d”
    mingw: true, nil, true, “d”

  4. $ echo foo > foo && ./ruby -e ‘f = File.open(“foo”); f.getc; p
    f.pos; f.ungetc(100); p f.pos’
    linux: 1, 0
    mingw: 1, 1

  5. $ ./ruby -e ‘File.open(“foo”, “w”) {|f|
    f.write_nonblock(“012345678901234567890123456789”) }’
    linux: e$BIaDL$K=q$-9~$^$l$ke(B
    mingw: EBADF

e$B$J$s$H$J$/A[A|$G$-$k$b$N$b$"$j$^$9$,!"e(BIO e$B$O$H$F$bFq2r$J$N$Ge(B
e$B2<<j$KH=CG$9$k$3$H$r$d$a$^$9!#e(B

2010e$BG/e(B2e$B7ne(B27e$BF|e(B1:13 Yusuke ENDOH [email protected]:

e$B0J2<$N$h$&$K!“e(BIO e$B$K4X$7$Fe(B Linux e$B$He(B mingw e$B$G5sF0$,0c$$$^$9!#e(B
e$B$=$l$>$l;EMM$G$7$g$&$+!”%P%0$G$7$g$&$+!#e(B

e$B$"$^$je(B Windows e$B$K>$7$/$O$J$$$N$G$9$,!“e(B
http://pub.cozmixng.org/~the-rwiki/rw-cgi.rb?cmd=view;name=Windows+��+IO
e$B$Ke(B Windows
e$B$GCm0U$7$J$$$H$$$1$J$$$3$H$r$$$/$i$+=q$$$F$”$j$^$9!#e(B

e$B;d$O%F%9%H4D6-$r;}$C$F$$$J$$$N$G0J2<$N5-=R$OC1$J$k?dB,$G$"$j!"e(B
e$B3N<B$JOC$G$O$J$$$H9M$($FFI$s$G$/[email protected]$5$$!#e(B

  1. $ ./ruby -e ‘f = File.open(“foo”, “w”); IO.for_fd(f.fileno, “r”)’
    linux: EINVAL
    mingw: [email protected]$o$J$$e(B (gets e$B$7$?$ie(B EBADF)
    e$B;29Me(B: http://redmine.ruby-lang.org/issues/show/1582

F_GETFL e$B$,$J$$$N$GL5M}$J$s$8$c$J$$$G$7$g$&$+!#e(B

  1. $ ./ruby -e ‘f1 = File.open(“foo”, “w”); f2 = IO.new(f1.fileno); p f2.gets’
    linux: IOError
    mingw: EBADF

F_GETFL e$B$,$J$$$N$G;vA0$KD4$Y$k$N$OL5M}$J$s$8$c$J$$$G$7$g$&$+!#e(B

  1. $ rm foo && touch foo && ./ruby -e ‘f = File.open(“foo”); p f.eof?;
    p f.getc; f.ungetc(100); p f.eof?; p f.getc’
    linux: true, nil, false, “d”
    mingw: true, nil, true, “d”

cbuf e$B$G$9$+$M$’!#e(B
e$B$3$l$Oe(B eof? e$B$,e(B false e$B$rJV$9$h$&$K$G$-$k5$$b$7$^$9!#e(B

[email protected]!"[email protected]$1D>$9$He(B cbuf e$B$,6u$G$J$/$Fe(B eof?
e$B$,56$N$H$-$Ke(B
e$B%P%$%HNs$JFI$9~$%a%=%C%I$,%V%m%C%/$9$k$h$&$J5$$,$9$k$J$!!#e(B
e$B$d$O$j$=$C$A$ONc30$G$9$+$M!#e(B

  1. $ echo foo > foo && ./ruby -e ‘f = File.open(“foo”); f.getc; p
    f.pos; f.ungetc(100); p f.pos’
    linux: 1, 0
    mingw: 1, 1

cbuf e$B$G$9$+$M$’!#e(B
cbuf e$B$KF~$C$F$$$k%G!<%?$O%P%$%HNs$H$7$F$b$H$b$He(B
e$B2?%P%$%H$"[email protected][email protected]$G$-$J$$$N$G!#e(B

  1. $ ./ruby -e ‘File.open(“foo”, “w”) {|f|
    f.write_nonblock(“012345678901234567890123456789”) }’
    linux: e$BIaDL$K=q$-9~$^$l$ke(B
    mingw: EBADF

Windows e$B$Ne(B non-blocking I/O e$B$Oe(B socket
[email protected]$J$s$8$c$J$$$G$7$g$&$+!#e(B

e$B%A%1%C%He(B #2796 e$B$,99?7$5$l$^$7$?!#e(B (by Akira T.)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

This issue was solved with changeset r27470.
Yusuke, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


http://redmine.ruby-lang.org/issues/show/2796

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:40508] Re: [Bug:trunk] IO behaviors on mingw”
on Feb.27,2010 01:43:30, [email protected] wrote:

e$B;d$O%F%9%H4D6-$r;}$C$F$$$J$$$N$G0J2<$N5-=R$OC1$J$k?dB,$G$"$j!"e(B
e$B3N<B$JOC$G$O$J$$$H9M$($FFI$s$G$/[email protected]$5$$!#e(B

      1. e$B$K$D$$$F$OEDCf$5$s$N$$C$7$c$k$H$$j$+$H;W$$$^$9!#e(B
        e$BA0e(B2e$B<T$O>-Mh$I$&$K$+$9$k$+$b$7$l$^$;$s!#$7$J$$$+$b$7$l$^$;$s!#e(B

e$B$H$3$m$G!"e(B3) e$B$de(B 4)
e$B$_$?$$$K%F%-%9%H%b!<%I$,Mm$s$G$=$&$JE[$O!"e(B
e$B%F%-%9%H%b!<%I$G%*!<%W%s$9$j$c4D6-Hs0MB8$G:F8=$G$-$k$H;W$&$Ne(B
e$B$G!"e(Bmingwe$B$H$+$KOC$r8BDj$7$J$$:F8=%1!<%9$r:n$C$F%P%0EPO?$7$?J}e(B
e$B$,$$$$$s$8$c$J$$$+$H;W$$$^$9!d1sF#$5$se(B

e$B$=$l$G$O!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs