Thread: Archive Manipulation

  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    56

    Archive Manipulation

    Let's say i have a simple archive file, i've figured its format, headers etc ) thru hexadecimal editor.
    Now whats the best approach for manipulating it in C++, like inserting a new file on it, editing its current data, making a list of included files, will only fstream class be enough?
    What i'm really looking for is a good tutorial covering this specific subject, i've already tried google, but only found documents explaning how to deal with fstream class, which I already read and practiced.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    If you already know the format of the file, the rest is just reading and writing bytes, which you can easily do with fstream.

    Perhaps create functions to read/write the following structures
    - archive header (describes the whole archive)
    - file header (describes a single file)
    - file data (compressed or not)
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jul 2010
    Posts
    56
    Bump

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Nice.
    Since you made no effort at all, closed.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C Bit Manipulation
    By Sicilian_10 in forum C Programming
    Replies: 4
    Last Post: 03-19-2010, 10:01 AM
  2. Extracting archive
    By cerebrassassin in forum C Programming
    Replies: 4
    Last Post: 10-26-2009, 02:52 AM
  3. Testers wanted - archiving tool.
    By cboard_member in forum Game Programming
    Replies: 25
    Last Post: 08-31-2006, 06:12 AM
  4. Bit Manipulation Questions
    By CPPNewbie in forum C++ Programming
    Replies: 7
    Last Post: 08-12-2003, 02:17 PM
  5. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 07:01 PM