Results 1 to 7 of 7

Thread: Compressing Files

  1. #1

    Thread Starter
    Member
    Join Date
    May 2002
    Location
    Great Britain
    Posts
    60

    Angry Compressing Files

    I'm find a way of compressing and encrypted large files without using too much memory.

    To do this I'm planning on reading in the file data 4MB at a time, compressing it, and encrypting it before writing to another file.

    The problem is the lack of a suitable compression algorithm. Is there one that will compress these 4MB chunks, but still consider them to be sections of a larger file?

    Hmmmm... Hope you know what I mean.

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    RAR can do that, but I don't think it's open.

    ZIP can do it too, you it's up to you to decide what to do with the compressed files.

    I could write an RLE algorithm that supports file splitting...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Basically, if you write your own compression/decompression tool you can use every compression algorithm for it.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4

    Thread Starter
    Member
    Join Date
    May 2002
    Location
    Great Britain
    Posts
    60
    It's not really what I meant. If I've got a 1 GB file (for example) and wanted to compress it then I wouldn't read in all 1 GB into memory at once. I want to read it 4 MB at a time, compress the 4MB chunk then output them sequentially to another file.
    I'm not really familiar with data compression, but I think it involved created 'dictionarys'? I need a method whereby the 4MB chunks would all share the same dictionary.

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Some use dictionaries like that. With zlib, you can compress your own sized blocks, normally about 32Ks worth in one function call. You can get prewritten stream interfaces for it (look for ozstream).
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  6. #6
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    u can use rar see in their page for the dll www.rarsoft.com
    \m/\m/

  7. #7
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    You can't get sources for that though.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width