Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Between infinite and short there is a big difference. -- G. H. Gonnet


dovenet / Synchronet Baja / Re: Syntax

SubjectAuthor
o Re: SyntaxNelgin

1
Re: Syntax

<20220313163633.526a33b6@wibble.sysadmininc.com>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=89&group=DOVE-Net.Synchronet_Baja#89

  copy link   Newsgroups: DOVE-Net.Synchronet_Baja
From: nelgin@VERT/EOTLBBS (Nelgin)
To: All
Subject: Re: Syntax
Message-ID: <20220313163633.526a33b6@wibble.sysadmininc.com>
Date: Sun, 13 Mar 2022 09:36:33 -0500
X-Comment-To: All
Path: rocksolidbbs.com!not-for-mail
Organization: End Of The Line BBS
Newsgroups: DOVE-Net.Synchronet_Baja
In-Reply-To: <20220313011239.5118fda9@wibble.sysadmininc.com><622E3549.51.dove-syncbaja@valhalla.synchro.net>
References: <20220313011239.5118fda9@wibble.sysadmininc.com><622E3549.51.dove-syncbaja@valhalla.synchro.net>
X-FTN-PID: Synchronet 3.19c-Linux master/5faf70b31 Mar 7 2022 GCC 9.3.0
X-FTN-CHRS: CP437 2
WhenImported: 20220313144607-0700 c1e0
WhenExported: 20220313175763-0700 c1e0
ExportedFrom: VERT bajaprog 4439
WhenImported: 20220313163633-0500 c168
WhenExported: 20220313164607-0500 c168
ExportedFrom: EOTLBBS dove-syncbaja 122
X-Newsreader: Claws Mail 4.0.0git423 (GTK+ 3.24.20; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
 by: Nelgin - Sun, 13 Mar 2022 14:36 UTC

On Sun, 13 Mar 2022 14:17:45 -0400
"DesotoFireflite" <desotofireflite@VERT/VALHALLA> wrote:

> Re: Re: Syntax
> By: Nelgin to All on Sun Mar 13 2022 01:12 am
>
> Ne> On Mon, 7 Mar 2022 13:14:24 -0500
> Ne> "DesotoFireflite" <desotofireflite@VERT/VALHALLA> wrote:
> >> Re: Syntax
> >> By: Digital Man to DesotoFireflite on Mon Mar 07 2022 08:58 am
>
> > DM>> Re: Syntax
> > DM>> By: DesotoFireflite to All on Mon Mar 07 2022 08:41 am
>
> > >>> I want to be able to add to the top of a file, but I can only
> > >>> find out how to add to the bottom of a file. Currently I am
> > >>> using:
>
> > >>> fopen file 0_CREAT|0_WRONLY|O_APPEND
> > >>> "C:\SBBS\XTRN\INFO\INFO.LST"
>
>
> > >>> and that appends to the bottom of the list, but I want to show
> > >>> the newest to oldest, not oldest to newest.
>
> > >>> I'm assuming I just leave off the O_APPEND, but is there a
> > >>> correct way.
>
> > DM>> Leaving off O_APPEND will *overwrite* the portions of the file
> > DM>> you write to. There is no standard method for "inserting" data
> > DM>> into a file. You would have to read the file contents and
> > DM>> re-write them with the "inserted" data first, then the old
> > DM>> data.
> DM>
>
> >> Ok, Thanks, that was what I was afraid off... Looks like I have
> >> some work to do. <BFG>
>
> Ne> What are you trying to achieve? If part of the file changes,
> Ne> could you use an include to read in the bit that changes, and
> Ne> then just write your included file?
>
> It's just a graffiti wall I'm working on, but I wrote it to put the
> new info at the bottom, but now I've changed my mind and wan't the
> newest additions at the top. Thanks for the suggestion. I'm gonna
> play with it in a few days as soon as time let's me. I got side
> tracked working on another project. Again, Thanks

Use the tac command :)

$ echo "feck
> drink
> girls
> arse"|tac
arse
girls
drink
feck

Seriously, a couple of ways to do it but you can probably modify the
answer given to this question easily enough.

https://stackoverflow.com/questions/17560511/reading-a-file-line-by-line-backwards
--
End Of The Line BBS - Plano, TX
telnet endofthelinebbs.com 23
---
� Synchronet � End Of The Line BBS - endofthelinebbs.com

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor