• Syntax

    From DesotoFireflite@VERT/VALHALLA to All on Mon Mar 7 08:41:36 2022
    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.ããThanksããSysOp: C.G. Learn, AKA: DesotoFirefliteãValhalla Home Services! - (Synchronet) - bbs.valhallabbs.comãValhalla II! - (GAP) - bbs.valhallabbs.com:24ãValhalla III! - (RemoteAccess) - bbs.valhallabbs.com:5023ãValhalla IIII! - (Dungeons & Dragons BBS) - bbs.valhallabbs.com:26ãValhalla Home Services Web! - http://bbs.valhallabbs.comãA Gamers Paradise - Over 150 Registered Online Game Doors!ãHome Of Odin's Maze Game Server!ãã--- Don't You Know, Can't You See, Don't You Understand!ã þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.netã
  • From MRO@VERT/BBSESINF to DesotoFireflite on Mon Mar 7 09:30:52 2022
    Re: Syntaxã 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.ããi probably could have done this like 15 or more years ago with baja, but I can't process the way to do it now.ããwhat i would do (which requires no brain power) is to cat your new line to a new file, then cat your current list to that file, then move that file over your info.lstããor if your list file has a date or something sortable, you could just sort the file.ã---ã þ Synchronet þ ::: BBSES.info - free BBS services :::ã
  • From Digital Man@VERT to DesotoFireflite on Mon Mar 7 08:58:41 2022
    Re: Syntaxã 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.ããLeaving off O_APPEND will *overwrite* the portions of the file you write to. There is no standard method for "inserting" data into a file. You would have to read the file contents and re-write them with the "inserted" data first, then the old data.ã-- ã digital man (rob)ããSling Blade quote #12:ãKarl (re hammer): I don't rightly know. I just kinda woke up holding it.ãNorco, CA WX: 56.3øF, 34.0% humidity, 7 mph NW wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From DesotoFireflite@VERT/VALHALLA to Digital Man on Mon Mar 7 13:14:24 2022
    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 you writeã DM> to. There is no standard method for "inserting" data into a file. Youã DM> would have to read the file contents and re-write them with the "inserted"ã DM> data first, then the old data.ããOk, Thanks, that was what I was afraid off... Looks like I have some work to do. <BFG>ããSysOp: C.G. Learn, AKA: DesotoFirefliteãValhalla Home Services! - (Synchronet) - bbs.valhallabbs.comãValhalla II! - (GAP) - bbs.valhallabbs.com:24ãValhalla III! - (RemoteAccess) - bbs.valhallabbs.com:5023ãValhalla IIII! - (Dungeons & Dragons BBS) - bbs.valhallabbs.com:26ãValhalla Home Services Web! - http://bbs.valhallabbs.comãA Gamers Paradise - Over 150 Registered Online Game Doors!ãHome Of Odin's Maze Game Server!ãã--- CAT (n.), Furry keyboard cover.ã þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.netã
  • From DesotoFireflite@VERT/VALHALLA to MRO on Mon Mar 7 13:18:57 2022
    Re: Syntaxã By: MRO to DesotoFireflite on Mon Mar 07 2022 09:30 amãã MR> Re: Syntaxã MR> 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. ãã MR> i probably could have done this like 15 or more years ago with baja, but Iã MR> can't process the way to do it now.ããI hear you, at 70, I'm loosing a lot of my skill set also. <BFG>ãã MR> what i would do (which requires no brain power) is to cat your new line toã MR> a new file, then cat your current list to that file, then move that fileã MR> over your info.lstãã MR> or if your list file has a date or something sortable, you could just sortã MR> the file.ããBoth good ideas, but I like the sort issue best. I may be able to pull that off, but I will have to look at the file first.ããThanksããSysOp: C.G. Learn, AKA: DesotoFirefliteãValhalla Home Services! - (Synchronet) - bbs.valhallabbs.comãValhalla II! - (GAP) - bbs.valhallabbs.com:24ãValhalla III! - (RemoteAccess) - bbs.valhallabbs.com:5023ãValhalla IIII! - (Dungeons & Dragons BBS) - bbs.valhallabbs.com:26ãValhalla Home Services Web! - http://bbs.valhallabbs.comãA Gamers Paradise - Over 150 Registered Online Game Doors!ãHome Of Odin's Maze Game Server!ãã--- The truth will set you free. But first it'll piss you off.ã þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.netã
  • From Nelgin@VERT/EOTLBBS to All on Sun Mar 13 01:12:39 2022
    On Mon, 7 Mar 2022 13:14:24 -0500
    "DesotoFireflite" <desotofireflite@VERT/VALHALLA> wrote:
    Re: Syntax
    By: Digital Man to DesotoFireflite on Mon Mar 07 2022 08:58 am

    Re: Syntax
    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.

    Leaving off O_APPEND will *overwrite* the portions of the file
    you write to. There is no standard method for "inserting" data
    into a file. You would have to read the file contents and
    re-write them with the "inserted" data first, then the old data.


    Ok, Thanks, that was what I was afraid off... Looks like I have some
    work to do. <BFG>

    SysOp: C.G. Learn, AKA: DesotoFireflite
    Valhalla Home Services! - (Synchronet) - bbs.valhallabbs.com
    Valhalla II! - (GAP) - bbs.valhallabbs.com:24
    Valhalla III! - (RemoteAccess) - bbs.valhallabbs.com:5023
    Valhalla IIII! - (Dungeons & Dragons BBS) - bbs.valhallabbs.com:26
    Valhalla Home Services Web! - http://bbs.valhallabbs.com
    A Gamers Paradise - Over 150 Registered Online Game Doors!
    Home Of Odin's Maze Game Server!

    --- CAT (n.), Furry keyboard cover.
    â–  Synchronet â–  Valhalla Home Services â–  USA â–  http://valhalla.synchro.net
    What are you trying to achieve? If part of the file changes, could you
    use an include to read in the bit that changes, and then just write
    your included file?
    --
    End Of The Line BBS - Plano, TX
    telnet endofthelinebbs.com 23
    ---
    ï¿­ Synchronet ï¿­ End Of The Line BBS - endofthelinebbs.com
  • From DesotoFireflite@VERT/VALHALLA to Nelgin on Sun Mar 13 14:17:45 2022
    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 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, could youã Ne> use an include to read in the bit that changes, and then just writeã Ne> 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ããSysOp: C.G. Learn, AKA: DesotoFirefliteãValhalla Home Services! - (Synchronet) - bbs.valhallabbs.comãValhalla II! - (GAP) - bbs.valhallabbs.com:24ãValhalla III! - (RemoteAccess) - bbs.valhallabbs.com:5023ãValhalla IIII! - (Dungeons & Dragons BBS) - bbs.valhallabbs.com:26ãValhalla Home Services Web! - http://bbs.valhallabbs.comãA Gamers Paradise - Over 150 Registered Online Game Doors!ãHome Of Odin's Maze Game Server!ãã--- Don't eat the yellow snow!ã þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.netã
  • From Nelgin@VERT/EOTLBBS to All on Sun Mar 13 16:36:33 2022
    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ã