Hi,

In message "[ruby-talk:25890] File access modes"
    on 01/11/20, "HarryO" <harryo / zipworld.com.au> writes:
|....  but I orginally wrote the File.open() as ...
|
|   File.open("counter", "w+")
|
|and the f.gets seemed to return an empty string every time,
|irrespective of whether the file already existed, and even if
|I put an extra f.rewind before it (although, I thought that was
|redundant).

man fopen

....

       w+     Open for reading and writing.  The file is created if it
              does not exist, otherwise it is truncated.  The stream
                                        ^^^^^^^^^^^^^^^
              is positioned at the beginning of the file.
....

							matz.