1. file numbers, puts, seek and NT 4

I suppose its written down somewhere, but with the following program, gday.ex,

    puts( 1, "G'day mate, 'owyergoin?" )

in Windows NT 4.0, repetitively executing

    ex gday >> gday.log

does not build up a file full of G'day's. Rather the puts simply writes the file
with a single line over and over again. If you want the append to occur you have
to rewrite the program as

    seek( 1, -1 )
    puts( 1, "G'day mate, 'owyergoin?" )

and then it will work as expected. This does not appear to be the case under
Windows 95 or MSDOS. This is a hidden gotcha. Either that or I have finally gone
round the twist. If its the latter, I can cope with the embarrassment. If the
former, the documentation better say something about it.

Bruce.

new topic     » topic index » view message » categorize

2. Re: file numbers, puts, seek and NT 4

Try putting a +AFw-n newline at the end of the string.
puts( 1, "G'day mate, 'owyergoin?+AFw-n" )

I think I've encountered that before, in NT.

Greg


Bruce M. Axtens wrote:

> I suppose its written down somewhere, but with the following program, gday.ex,
>
>     puts( 1, "G'day mate, 'owyergoin?" )
>
> in Windows NT 4.0, repetitively executing
>
>     ex gday >> gday.log
>
> does not build up a file full of G'day's. Rather the puts simply writes the
> file
> with a single line over and over again. If you want the append to occur you
> have
> to rewrite the program as
>
>     seek( 1, -1 )
>     puts( 1, "G'day mate, 'owyergoin?" )
>
> and then it will work as expected. This does not appear to be the case under
> Windows 95 or MSDOS. This is a hidden gotcha. Either that or I have finally
> gone
> round the twist. If its the latter, I can cope with the embarrassment. If the
> former, the documentation better say something about it.
>
> Bruce.



--
Greg Phillips
i.shoot at rednecks.com
http://euphoria.server101.com
--

Useless fact of the day:

The Queen termite can live up to 50 years and have 30,000 children every day.

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

3. Re: file numbers, puts, seek and NT 4

Greg Phillips wrote on Fri, 23 Apr 1999:
>Try putting a +AFw-n newline at the end of the string.
>puts( 1, "G'day mate, 'owyergoin?+AFw-n" )
>
>I think I've encountered that before, in NT.
>

Eeek! Where's that in the documentation, Rob! Whew, so I don't have a kangaroo
loose in the top paddock after all.

Bruce.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu