1. File output

How do I output to a file without overwriting it? I used 
open(file,"u")--update
puts(fn,"blah") 
and it overwrites what is already in the file

new topic     » topic index » view message » categorize

2. Re: File output

Jacen wrote:
> 
> How do I output to a file without overwriting it? I used 
> open(file,"u")--update
> puts(fn,"blah") 
> and it overwrites what is already in the file

you need to use open(file,"a") for "append."


-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

3. Re: File output

You need to use append mode.

Update mode allows you to open a file for reading and writing, the
position starts at the beginning of the file. Append is for adding to
an existing file (write only). The position starts at the end of the
file.

Try:
fn =  open(file,"a")
puts(fn,"blah")


On Sun, 28 Nov 2004 17:18:49 -0800, Jacen <guest at rapideuphoria.com> wrote:
> 
> posted by: Jacen <pip at mail.sylvancomputers.com>
> 
> How do I output to a file without overwriting it? I used
> open(file,"u")--update
> puts(fn,"blah")
> and it overwrites what is already in the file
> 
> 
> 
> 


-- 
MrTrick

new topic     » goto parent     » topic index » view message » categorize

4. Re: File output

Jacen wrote:
> 
> How do I output to a file without overwriting it? I used 
> open(file,"u")--update
Re-read the docs on open(), you need to use a, not u.

> puts(fn,"blah") 
> and it overwrites what is already in the file
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu