Re: Fast way to compare two files using STL?

Discussion in 'C++' started by Thomas Matthews, Aug 18, 2003.

  1. John Villalovos wrote:

    > I was wondering if people had any ideas on a fast way to compare two files (on
    > Linux) using the STL.

    Files are in the domain of the operating system.
    Operating systems should be very good at copying and comparing files.
    Use either a system command:
    system("diff file_a file_b > results")
    or system specific functions.

    Also, there are a plethora of file compare utilities. Check them
    out.

    --
    Thomas Matthews

    C++ newsgroup welcome message:
    http://www.slack.net/~shiva/welcome.txt
    C++ Faq: http://www.parashift.com/c -faq-lite
    C Faq: http://www.eskimo.com/~scs/c-faq/top.html
    alt.comp.lang.learn.c-c++ faq:
    http://www.raos.demon.uk/acllc-c /faq.html
    Other sites:
    http://www.josuttis.com -- C++ STL Library book
    Thomas Matthews, Aug 18, 2003
    #1
    1. Advertising

  2. In article <MG50b.26708$>,
    Thomas Matthews <> wrote:
    >John Villalovos wrote:
    >
    >> I was wondering if people had any ideas on a fast way to compare two files
    >> (on Linux) using the STL.

    >Files are in the domain of the operating system.
    >Operating systems should be very good at copying and comparing files.
    >Use either a system command:
    > system("diff file_a file_b > results")
    >or system specific functions.
    >
    >Also, there are a plethora of file compare utilities. Check them
    >out.


    Thanks.

    I'll be honest and say, Yuck! :) I don't like writing code which does a
    "system()" call. Must be my personality :) But you are right in that diff
    works well and is quite fast.

    John
    John Villalovos, Aug 18, 2003
    #2
    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. Gianni Mariani
    Replies:
    1
    Views:
    849
    Pete Becker
    Aug 16, 2003
  2. Kevin Goodsell
    Replies:
    0
    Views:
    417
    Kevin Goodsell
    Aug 16, 2003
  3. John Villalovos
    Replies:
    0
    Views:
    411
    John Villalovos
    Aug 18, 2003
  4. GenxLogic
    Replies:
    3
    Views:
    1,240
    andrewmcdonagh
    Dec 6, 2006
  5. Replies:
    5
    Views:
    492
    Markus Schoder
    Apr 16, 2006
Loading...

Share This Page