From: Scott Sheffield
Subject: Easy question
Date: 
Message-ID: <36F7E767.B3E37116@lmco.com>
How do you open up an output file stream so you can write data in the
middle of a file? When I open using :overwrite, it erases the file. When
I use :append it writes my data to the end of the file even when I set
the file position to a point inside the file. What am I doing wrong?
Thanks,
Scott

From: Vassil Nikolov
Subject: open in RW mode (Ex: Re: Easy question)
Date: 
Message-ID: <7d9boo$sld$1@nnrp1.dejanews.com>
In article <·················@lmco.com>,
  Scott Sheffield <·················@lmco.com> wrote:
> How do you open up an output file stream so you can write data in the
> middle of a file? When I open using :overwrite, it erases the file. When
> I use :append it writes my data to the end of the file even when I set
> the file position to a point inside the file. What am I doing wrong?
> Thanks,
> Scott

:direction :io
:if-exists :overwrite

Vassil Nikolov <········@poboxes.com> www.poboxes.com/vnikolov
(You may want to cc your posting to me if I _have_ to see it.)
   LEGEMANVALEMFVTVTVM  (Ancient Roman programmers' adage.)

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    
From: Erik Naggum
Subject: Re: Easy question
Date: 
Message-ID: <3131223793164284@naggum.no>
* Scott Sheffield <·················@lmco.com>
| How do you open up an output file stream so you can write data in the
| middle of a file?  When I open using :overwrite, it erases the file.
| When I use :append it writes my data to the end of the file even when I
| set the file position to a point inside the file.  What am I doing wrong?

  instead of trying :IF-EXISTS options, look at :DIRECTION.

  incidentally, :IF-EXISTS OVERWRITE should _not_ erase the file.

#:Erik
From: Kent M Pitman
Subject: Re: Easy question
Date: 
Message-ID: <sfwu2vbu1xu.fsf@world.std.com>
Scott Sheffield <·················@lmco.com> writes:

> How do you open up an output file stream so you can write data in the
> middle of a file? When I open using :overwrite, it erases the file. When
> I use :append it writes my data to the end of the file even when I set
> the file position to a point inside the file. What am I doing wrong?
> Thanks,
> Scott

Try opening in :APPEND mode and moving the file position around.
(Whether it works may be implementation-dependent, since it may depend
on characteristics of the underlying file system to support.  If you
read the description of :append in the definition of OPEN, I think
you'll see this is at least not too far-fetched.)