[#63592] [ruby-trunk - Bug #10009] IO operation is 10x slower in multi-thread environment — normalperson@...
Issue #10009 has been updated by Eric Wong.
3 messages
2014/07/08
[#63682] [ruby-trunk - Feature #10030] [PATCH] reduce rb_iseq_struct to 296 bytes — ko1@...
Issue #10030 has been updated by Koichi Sasada.
3 messages
2014/07/13
[#63703] [ruby-trunk - Feature #10030] [PATCH] reduce rb_iseq_struct to 296 bytes — ko1@...
Issue #10030 has been updated by Koichi Sasada.
3 messages
2014/07/14
[#63743] [ruby-trunk - Bug #10037] Since r46798 on Solaris, "[BUG] rb_vm_get_cref: unreachable" during make — ngotogenome@...
Issue #10037 has been updated by Naohisa Goto.
3 messages
2014/07/15
[#64136] Ruby 2.1.2 (and 2.1.1 and probably others) assumes a libffi with 3 version numbers in extconf.rb — "Jeffrey 'jf' Lim" <jfs.world@...>
As per subject.
4 messages
2014/07/31
[#64138] Re: Ruby 2.1.2 (and 2.1.1 and probably others) assumes a libffi with 3 version numbers in extconf.rb
— "Jeffrey 'jf' Lim" <jfs.world@...>
2014/07/31
On Thu, Jul 31, 2014 at 6:03 PM, Jeffrey 'jf' Lim <[email protected]>
[ruby-core:63878] [ruby-trunk - Bug #10039] [Closed] "a+" mode for File.open doesn’t work
From:
nobu@...
Date:
2014-07-19 15:32:58 UTC
List:
ruby-core #63878
Issue #10039 has been updated by Nobuyoshi Nakada.
Status changed from Open to Closed
% Done changed from 0 to 100
Applied in changeset r46876.
----------
io.c: fix rdoc of append mode
* io.c (rb_io_initialize): [DOC] fix rdoc of append mode. it does
not move the pointer at open. [ruby-core:63747] [Bug #10039]
----------------------------------------
Bug #10039: "a+" mode for File.open doesn=E2=80=99t work
https://bugs.ruby-lang.org/issues/10039#change-47902
* Author: Marvin G=C3=BClker
* Status: Closed
* Priority: Normal
* Assignee:=20
* Category: doc
* Target version:=20
* ruby -v: ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
Hi there,
According to [the documentation](http://www.ruby-doc.org/core-2.1.2/IO.html=
#method-c-new) the "a+" file open mode should open a file:
> Read-write, starts at end of file if file exists
However, it appears that the "a+" mode behaves exactly as "r+", i.e. the fi=
le pointer is placed at the beginning of the file instead of the end.
This example demonstrates the problem:
~~~
(288) [20:37:02 quintus@hades] /tmp/foobar
% cat test.txt=20
test
test2
(289) [20:37:07 quintus@hades] /tmp/foobar
% irb
irb(main):001:0> f =3D File.open("test.txt", "a+")
=3D> #<File:test.txt>
irb(main):002:0> f.pos
=3D> 0
irb(main):003:0> f.eof?
=3D> false
irb(main):004:0> f.read
=3D> "test\ntest2\n"
irb(main):005:0> f.pos
=3D> 10
irb(main):006:0> f.close
=3D> nil
irb(main):007:0>=20
~~~
The file position pointer should have been placed at the end of the file (i=
.e. position 10), not at the beginning (which is what "r+" is for).
Vale,
Quintus
--=20
https://bugs.ruby-lang.org/