Thread: Package multipe files in one. Resource management?

  1. #1
    Registered User
    Join Date
    Sep 2014
    Posts
    121

    Package multipe files in one. Resource management?

    Hello,
    I want to make a custom program for packaging multiple files in one. Not as complicated as ZLIB or others. Consider few files, XML, txt, JPG, OGG, I want them to be added in 1 file. Not visible not readable. Just a datafile. I have some ideas about creating some kind of indexing of the start byte, end byte of each file. But I am still way too far. Can you point me some direction at what should I stress in creating this software. It will be portable since I am planning to use stdlib, stdio only, maybe and string to recreate the filenames from the large chunk datafile.

  2. #2
    Registered User
    Join Date
    Nov 2012
    Posts
    1,393
    Have you looked at the TAR format? Here is a link. If you want to make a custom format that may give you some ideas.

    GNU tar 1.28: Basic Tar Format

    By the way, ZLIB is not really meant for packaging multiple files. It is only for compression. I really think TAR is what you want. If you don't want to make it yourself there are also ready solutions available like PhysicsFS PhysicsFS

  3. #3
    Registered User
    Join Date
    Sep 2014
    Posts
    121
    Quote Originally Posted by c99tutorial View Post
    Have you looked at the TAR format? Here is a link. If you want to make a custom format that may give you some ideas.

    GNU tar 1.28: Basic Tar Format

    By the way, ZLIB is not really meant for packaging multiple files. It is only for compression. I really think TAR is what you want. If you don't want to make it yourself there are also ready solutions available like PhysicsFS PhysicsFS
    Thanks, I saw it. It appears it won`t be a few-hours-fun-job to make such a thing. PhysicsFS is quite good. It`s actually ready and downloadable with .h/.c files. Tar however looks quite complicated, but have the things I need. It genereate files form the chunk and vice versa. My idea was to read files into memory, then dump them into a single file. For now this is my target, re-generate of the files form the chunk will be the next step. I`ll look into PhysicsFS .c file to see if I can get some clues.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Resource Management - Files
    By darren78 in forum C++ Programming
    Replies: 19
    Last Post: 08-14-2010, 01:51 PM
  2. Resource Management question..
    By Raigne in forum C++ Programming
    Replies: 37
    Last Post: 03-08-2008, 09:36 AM
  3. More resource management troubles
    By VirtualAce in forum Game Programming
    Replies: 4
    Last Post: 09-25-2007, 02:23 AM
  4. Resource management...again
    By VirtualAce in forum Game Programming
    Replies: 3
    Last Post: 11-29-2006, 04:50 AM
  5. Mmk, I give up, lets try your way. (Resource Management)
    By Shamino in forum Game Programming
    Replies: 31
    Last Post: 01-18-2006, 09:54 AM

Tags for this Thread