Rubyspec: File.new raises an Errno::EINVAL error with File::APPEND FAILED

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

foo.txt e$B$H$$$&%U%!%$%k$,B8:_$9$k>u67$G!"e(B

File.new(“foo.txt”, File::APPEND)

e$B$de(B

File.new(“foo.txt”, File::RDONLY|File::APPEND)

e$B$r<B9T$9$k$H!"e(B1.8 e$B$G$Oe(B Errno::EINVAL
e$B$,Ej$2$i$l$F$$$?$N$,e(B 1.9 e$B$G$Oe(B
e$B%(%i!<$K$J$i$J$/$J$C$F$$$^$9!#e(B

1.9 e$B$,e(B IO e$B$NFbItI=8=$Ke(B FILE
e$B9=B$BN$r;H$o$J$/$J$C$?1F6A$+$HM=A[$9$ke(B
e$B$N$G$9$,!"@5$7$$$G$7$g$&$+!#e(B
e$B$=$N>l9g!";EMMJQ99$H$$$&$3$H$G$$$$$G$7$g$&$+!#e(B
1.8 e$B$N%3!<%I$rA4$/[email protected]$C$F$k$N$G4X78$J$+$C$?$i$9$_$^$;$s!#e(B

e$B$J$s$H$J$/e(B SUSv3 e$B$r8+$F$_$?$H$3$m!"e(B

http://www.opengroup.org/onlinepubs/009695399/functions/open.html

O_APPEND e$B$Oe(B (write e$B$NA0$Ke(B) file offset
e$B$r=*C<$K;}$C$F$/$k$H$$$&[email protected]$1e(B
e$B$G!"e(BO_RDONLY
e$B$HAH$_9g$o$;$F$O$$$1$J$$$h$&$J$3$H$O=q$+$l$F$$$J$$$N$Ge(B
1.9 e$B$,@5$7$$5$$,$7$^$9e(B (FILE
e$B9=B$BN$r%P%C%/%(%s%I$K$7$F$$$k$HFq$7$$e(B
e$B$N$+$b$7$l$^$;$s$,e(B) e$B!#e(B

2010e$BG/e(B2e$B7ne(B10e$BF|e(B23:20 Yusuke ENDOH [email protected]:

e$B$r<B9T$9$k$H!"e(B1.8 e$B$G$Oe(B Errno::EINVAL e$B$,Ej$2$i$l$F$$$?$N$,e(B 1.9 e$B$G$Oe(B
e$B%(%i!<$K$J$i$J$/$J$C$F$$$^$9!#e(B

1.9 e$B$,e(B IO e$B$NFbItI=8=$Ke(B FILE e$B9=B$BN$r;H$o$J$/$J$C$?1F6A$+$HM=A[$9$ke(B
e$B$N$G$9$,!"@5$7$$$G$7$g$&$+!#e(B
e$B$=$N>l9g!";EMMJQ99$H$$$&$3$H$G$$$$$G$7$g$&$+!#e(B
1.8 e$B$N%3!<%I$rA4$/[email protected]$C$F$k$N$G4X78$J$+$C$?$i$9$_$^$;$s!#e(B

1.8.8 e$B$G$Oe(B fdopen(fd, “a”) e$B$,e(B EINVAL
e$B$K$J$C$F$$$^$9$M!#e(B

1.8.1 e$B0JA0$Oe(B EINVAL e$B$K$J$i$J$$$N$G$9$,!"$3$l$Oe(B fdopen(fd,
“r”) e$B$He(B
e$B$J$C$F$$$k$+$i$N$h$&$G$9!#e(B

O_APPEND e$B$Oe(B (write e$B$NA0$Ke(B) file offset e$B$r=*C<$K;}$C$F$/$k$H$$$&[email protected]$1e(B
e$B$G!"e(BO_RDONLY e$B$HAH$_9g$o$;$F$O$$$1$J$$$h$&$J$3$H$O=q$+$l$F$$$J$$$N$Ge(B
1.9 e$B$,@5$7$$5$$,$7$^$9e(B (FILE e$B9=B$BN$r%P%C%/%(%s%I$K$7$F$$$k$HFq$7$$e(B
e$B$N$+$b$7$l$^$;$s$,e(B) e$B!#e(B

1.8.2 e$B$+$ie(B 1.8.8
e$B$,4V0c$C$F$$$k!"$H$$$&$N$,AGD>$J5$$,$7$^$9!#e(B

e$B$"$H!"e(Bfd e$B$+$ie(B O_APPEND
e$B$+$I$&$+D4$Y$i$l$J$$4D6-$G$O8=>u$Ne(B 1.8 e$B$G$be(B
EINVAL e$B$K$O$J$C$F$$$J$$5$$,$7$^$9$M!#e(BWindows e$B$H$+e(B?

e$B1sF#$G$9!#e(B

2010e$BG/e(B2e$B7ne(B11e$BF|e(B19:33 Tanaka A. [email protected]:

2010e$BG/e(B2e$B7ne(B10e$BF|e(B23:20 Yusuke ENDOH [email protected]:

e$B$r<B9T$9$k$H!"e(B1.8 e$B$G$Oe(B Errno::EINVAL e$B$,Ej$2$i$l$F$$$?$N$,e(B 1.9 e$B$G$Oe(B
e$B%(%i!<$K$J$i$J$/$J$C$F$$$^$9!#e(B
snip

O_APPEND e$B$Oe(B (write e$B$NA0$Ke(B) file offset e$B$r=*C<$K;}$C$F$/$k$H$$$&[email protected]$1e(B
e$B$G!"e(BO_RDONLY e$B$HAH$_9g$o$;$F$O$$$1$J$$$h$&$J$3$H$O=q$+$l$F$$$J$$$N$Ge(B
1.9 e$B$,@5$7$$5$$,$7$^$9e(B (FILE e$B9=B$BN$r%P%C%/%(%s%I$K$7$F$$$k$HFq$7$$e(B
e$B$N$+$b$7$l$^$;$s$,e(B) e$B!#e(B

1.8.2 e$B$+$ie(B 1.8.8 e$B$,4V0c$C$F$$$k!"$H$$$&$N$,AGD>$J5$$,$7$^$9!#e(B

e$B$"$j$,$H$&$4$6$$$^$9!#$=$N$h$&$Ke(B rubyspec [email protected]$7$^$7$?!#e(B

e$B$"$H!"e(Bfd e$B$+$ie(B O_APPEND e$B$+$I$&$+D4$Y$i$l$J$$4D6-$G$O8=>u$Ne(B 1.8 e$B$G$be(B
EINVAL e$B$K$O$J$C$F$$$J$$5$$,$7$^$9$M!#e(BWindows e$B$H$+e(B?

rubyspec e$B$C$FIaDL$Ke(B fork e$B$H$+;H$C$F$$$F!“e(Bwindows
e$B$N$3$H$r$”$^$je(B
e$B9M$($F$J$$$h$&$J5$$,$7$^$9!#:G6ae(B fork
e$B$,$"$k$+$I$&$+$rH=Dj$9$ke(B
guard e$B$,F~$j$^$7$?$,!#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