Re: FILE I/O in reverse order?

Discussion in 'C Programming' started by Mark, Jan 12, 2004.

  1. Mark

    Mark Guest

    "Mark" <> wrote in message news:...
    > Hi, I have an app that needs to maintain a log file of certain events that
    > occur. Normally FILE I/O appends new text to the end of a file. However
    > one of the requirements of my app is that the most recent log entries need
    > to be at the beginning of the file. My initial thought is that the file
    > would have to be rewritten every time a new log entry is added. Can

    anyone
    > suggest a better/simpler way?
    >
    > An alternative would be to write the log as normal, then use a separate

    app
    > to post-process the log file into the most-recent-first order required.
    >
    > Thanks alot!
    >
    > Mark
    >
    >


    Hi guys, thanks for the all the responses! After thinking about it a bit
    more I think the simplest approach is best ... just write the file as normal
    and then rearrange it in the most-recent-first order later.

    Thanks!

    Mark
    Mark, Jan 12, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shannon Yoder

    How do I list records in reverse order?

    Shannon Yoder, Aug 14, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    380
  2. Guest
    Replies:
    1
    Views:
    406
    William F. Robertson, Jr.
    Oct 28, 2003
  3. dogbite
    Replies:
    4
    Views:
    682
    osmium
    Oct 10, 2003
  4. sahukar praveen

    reading a file in reverse order (bootom-top)

    sahukar praveen, Nov 25, 2003, in forum: C Programming
    Replies:
    20
    Views:
    755
    CBFalconer
    Dec 7, 2003
  5. Mark

    FILE I/O in reverse order?

    Mark, Jan 10, 2004, in forum: C Programming
    Replies:
    8
    Views:
    423
    alphatan['a:lfa:ta2n]
    Jan 12, 2004
Loading...

Share This Page