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ã