Re: HELP- with open("ab")

new topic     » goto parent     » topic index » view thread      » older message » newer message

Al,

Thanks for the suggestion. Tried open(fn,"a") and printf(), as you suggested, 
but it also results in the ascii 26 (eof)
character being present befor the newly appended record. Also, text editors (not
ED, which doesn't see past the ascii
26) show an additional (apparently completely empty) line following the appended
record.

I, no doubt could use EDS to handle the job, but I really would like to
understand what's causing the problem (me, I'm
sure, but how?).

Regards,

Jim Duffy


Really stumped by this problem.

Al Getz wrote:

> The problem is a text file should be opened in "a" mode (append text).
>
>   --Sample:
>
>   --say textfile1.txt is an existing text file...
>
>   include file.e
>
>   atom fp1
>
>   --opens text file in append text mode:
>   fp1=open("c:\\Euphoria\\Projects\\Tests\\textfile1.txt", "a")
>
>   --prints next line in text file:
>   printf(fp1,"%s\n",{"This will be next line printed to text file."})
>
>   --closes the file:
>   close(fp1)
>
>   --the documentation for Euphoria v2.0 says the file must exist, yet
>   --opening in the "a" mode with a filename that doesnt exist starts
>   --a new 0 length file as if opened in the "w" mode.
>
>   Good luck with it,
>     --Al

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu