How to omit a header?

Discussion in 'C Programming' started by RB, Jul 1, 2003.

  1. RB

    RB Guest

    What is the best way to omit a header (44 bytes length) from a binary file?

    Thanks in advance,
    Rita
     
    RB, Jul 1, 2003
    #1
    1. Advertisements

  2. Proper method:
    Copy the entire file, less the header to a new file.
    Remove the old file.

    Alternative:
    Copy the 45th byte and on up to the start of the file,
    thus overwriting the original data in the file. This
    will not shrink the file at the end.

    Another alternative:
    Read and ignore the header.
    Or just seek past it.

    --
    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, Jul 1, 2003
    #2
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.