[前][次][番号順一覧][スレッド一覧]

ruby-changes:8475

From: usa <ko1@a...>
Date: Wed, 29 Oct 2008 00:28:07 +0900 (JST)
Subject: [ruby-changes:8475] Ruby:r20008 (trunk): * win32/win32.c (rb_w32_open): need to seek to the end of the file when

usa	2008-10-29 00:27:06 +0900 (Wed, 29 Oct 2008)

  New Revision: 20008

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20008

  Log:
    * win32/win32.c (rb_w32_open): need to seek to the end of the file when
      O_APPEND is specified.

  Modified files:
    trunk/ChangeLog
    trunk/win32/win32.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 20007)
+++ ChangeLog	(revision 20008)
@@ -1,3 +1,8 @@
+Wed Oct 29 00:26:00 2008  NAKAMURA Usaku  <usa@r...>
+
+	* win32/win32.c (rb_w32_open): need to seek to the end of the file when
+	  O_APPEND is specified.
+
 Wed Oct 29 00:08:05 2008  Tadayoshi Funaba  <tadf@d...>
 
 	* math.c (rb_math_{atan2,cos,cosh,hypot,log,sin,sinh,sqrt}): added.
Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 20007)
+++ win32/win32.c	(revision 20008)
@@ -4129,8 +4129,10 @@
 	    fd = -1;
 	    goto quit;
 	}
-	if (!(flags & (FDEV | FPIPE)) && (oflag & O_APPEND))
+	if (!(flags & (FDEV | FPIPE)) && (oflag & O_APPEND)) {
 	    flags |= FAPPEND;
+	    SetFilePointer(h, 0, NULL, FILE_END);
+	}
 
 	_set_osfhnd(fd, (long)h);
 	_osfile(fd) = flags | FOPEN;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]