Issue #3198 has been updated by Usaku NAKAMURA.

Status changed from Assigned to Rejected
Assignee changed from Akio Tajima to Usaku NAKAMURA

???????arton??????????????????????????????????????????????????
?????????????????????????????????reject???
??????????????解決????誰????????????????????????????????????????????

# ??????????suspend????????????remote thread注??????????????????
# ???????????????????????????????????????????
----------------------------------------
Bug #3198: O_APPEND for redirect fd is ignored on windows
http://redmine.ruby-lang.org/issues/3198

Author: _ wanabe
Status: Rejected
Priority: Normal
Assignee: Usaku NAKAMURA
Category: core
Target version: 1.9.x
ruby -v: ruby 1.9.2dev (2010-04-24 trunk 22784) [i386-mingw32]


=begin
 Windows7 ????????????????????????????????????????
 O_APPEND ???渡???????????????????????
 
 $ cat test.rb
 fname = "tmp.out"
 File.delete fname if File.exist? fname
 5.times do
   system("echo a", STDOUT=>[fname, File::WRONLY|File::CREAT|File::APPEND, 0644])
 end
 p IO.read(fname)
 
 $ ruby -v test.rb
 ruby 1.9.2dev (2010-04-24 trunk 22784) [i386-mingw32]
 "a\n"
 
 以?????????????????????????????????????????対????????????????????????????????????????
 rb_w32_open ??????????????????????????????????????????????????????????以??????
 O_APPEND ????????????????????????????????????????? process.c ??????????????????
 
 Index: process.c
 ===================================================================
 --- process.c (revision 27483)
 +++ process.c (working copy)
 @@ -2094,6 +2094,11 @@ run_exec_open(VALUE ary, VALUE save, char *errmsg, size_t errmsg_buflen)
              ERRMSG("open");
              return -1;
          }
 +#if defined(_WIN32)
 +	if (flags & O_APPEND) {
 +	    lseek(fd2, 0, SEEK_END);
 +	}
 +#endif
          while (i < RARRAY_LEN(ary) &&
                 (elt = RARRAY_PTR(ary)[i], RARRAY_PTR(elt)[1] == param)) {
              fd = FIX2INT(RARRAY_PTR(elt)[0]);
=end



-- 
http://redmine.ruby-lang.org