We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Compress and uncompress TFileStream

yc
yc asked
on
Medium Priority
991 Views
Last Modified: 2008-02-07
I am looking for the source code of free component that can compressing/uncompressing so as using TFileStream.

Thanks for any helping.
Ye Chen
Comment
Watch Question

Commented:
There are lots of compression units with sources. I doubts there is something specific for TFileStream - what exatly do you expect it to do.

Anyway, if you're interested, you can find lots of ZIP like units for Delphi to allow compression with files.
yc

Author

Commented:
Hi, Matvey!

I found gwdc0061.zip has compress AND uncompress procedures.
But its compress ratio is low, and the speed is not important
for me.

Before i try to download zipsfx_s.zip and diffm134.zip, i want to know the two components has compress AND uncompress function.

Please give some time to try the other you offering.

Thanks for your help.

Commented:
Here, see this whole page of Delphi compression components:

http://torry.magnitka.ru/compress.htm
yc

Author

Commented:
I found Diffmake can only the different part of two files.

I just need Tfilestrem component that can compress and uncompress
with the max compress ratio.

Commented:
I can't believe you found nothing on the last page. Should I encist you visit it?

http://torry.magnitka.ru/compress.htm
yc

Author

Commented:
I had visited http://torry.magnitka.ru/compress.htm
On this Page, following are kind of FWS:
1) Chief's UnZip v1.00a
      Chiefzip.zip (Does it have compress function?)
2) ChiefLZ v1.02
      Chieflz.zip (I can't build it with Delphi 4.0)
3) Data Compressors for Delphi v1.00
      GWDC0061.zip (I wanted the higher compress ratio than it.)
4) Delphi Zip v1.40
      Delzip.exe (I can't link to http://www-afsc.saia.af.mil/~englere/)
5) Delphi Zip DLL v1.40
6) InfoZip
7) PPack v1.1
8) PasZLIB v1.1

Would tell me which is the I need?
yc

Author

Commented:
Adjusted points to 100

Commented:
OK, I'll look. As far as I know best compression is the RAR compressor. I saw there a RAR compression unit...
Anyway, I'll tell you what is working there.

c u, Matvey

Commented:
PS leave your email meanwhile...

bosism@netvision.net.il

Commented:
Did you try zLib? or PasZLib in torry is the pascal port of zLib.
If you have Delphi3 you should be able to find the zlib code in "extras" directtory, the homepage for zlib is http://www.cdrom.com/pub/infozip/zlib/


yc

Author

Commented:
Hi, kjteng

I am now using Delphi 4.0

I don't known the meaning of "extras", please give me the full path of the Zlib compontent i need to download.

I think the information you offered seems to be the thing i need.

Thanks very much.

Y.C.
yc

Author

Commented:
Hi, kjteng

I am now using Delphi 4.0

I don't known the meaning of "extras", please give me the full path of the Zlib compontent i need to download.

I feel the information you offered seems to be the thing i need.

Thanks very much.

Y.C.

Commented:
In delphi 3 CD. there is a info\extras\ folder which contains some extra stuff such as zlib and jpeg library.
I do not have delph4 but I think zlib should be in there.
In case you can find it or if you want to have the latest version, go to this site:
   http://www.cdrom.com/pub/infozip/zlib/



yc

Author

Commented:
Hi, kjteng

I think you have already give me an satisfaction already.

Thanks you again.

yc

Author

Commented:
Hi, Matvey

I think Kjteng have already give me an satisfaction already.

Thanks you again.

Commented:
OK, no problem. I still haven't looked at the tons of files on Torry's page, so if you don't want me to anymore - no problem...

Commented:
I have some code that I use with Zlib for my program.  It has multiple file support and has simple to use methods (Add, Extract, CopyFrom, Delete, Pack).  It doesn't use a zip file format.....its kind of a propritary one.  If you are interested in the code I'd be glad to let you see it.  

Supports:
Multiple file compression
Saves all date/attributes/etc. information
Path modes full/relative/none
Full Grep support for compressed file as well as files on disk (eg you can say Extract '*.*' and it will based on the value of IncludeSubFolders)

I just finished modifing it yesterday and am still beta testing it completly.  I have tested all the above methods, but there could be bugs of course.

Let me know when you need,
Scott
yc

Author

Commented:
Hi, Scott

I am very glad to see the code you programming.

If it is large, please send email to yc@lansuite.com

Thanks very much.

Ye Chen

Commented:
Will you consider adding me to the list?

Many thanks,  bosism@netvision.net.il

Commented:
I'm interested too. gjdeng@yahoo.com
Thanks

Commented:
I am adding comments to it so that it is easier to read.  

Also, give me a little time to do a little more debugging.  So far it is working perfectly.  I'm going to run a stress test on it today or next week.  Also, I have two procedures to finish really quickly so that it is fully functional  (A stream to stream copier and a verify directory procedure)

I'll send everyone the code next week sometime (More than likely on Monday or Tuesday).  I will include a project called Compressor/Decompressor that will allow you to view exactly how to make the calls.  I'll try to get delete and update included in the project.

I didn't realize everyone would want it.  (Should have kept my mouth shut for a few more days :-)

To give you an idea of what you will get here is a list of objects that you will be able to use when I get it out:

TCompressFile  -- Has all functions for the compression and decompression
TGrepControl -- This is a "list" of greps for multiple level grepping.  You can start a new grep while one is running and, when you are done with the new grep, the old grep will be reactivated.
TGrep -- This is a single grep.  It supports only * and ? and characters right now.  It is mainly a DOS filemask utility for filename comparison.

Also, if you are concerned about cost, it will all be FREEWARE with SOURCE CODE included.  (I had to write it for a current project, so I'm already being paid for it :-)

Scott

Commented:
Ok, I tested it and found one bug.  The Update function was malfunctioning.  I'm ready to send it to you all, but I'd like a good "freeware license" to put inside all my Units.  Additionally, I'd like everyone to look at it and tell me what you think needs to be added, removed, etc and what you would like to see in a component of it.  Right now, it is a TObject decendant.  I'm not sure what to make properties and what not to.  The main reason for this is that for each call to Add or Extract the preferences could change (IncludeSubFolders, PathMode, etc) and making them properties would just make changing preferences a pain---but at the same time, maybe a person wants the same preferences all the time....you see my dilema.  

Anyway, if I can find a good freeware license, I'll send it to you right away.

Scott
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Commented:
I'd like to see your work Jacco.

My e-mail is Scott.Miller@imb.org
yc

Author

Commented:
Hi!

I think my question should be ended.

I think Kjteng's help is the key for my question.

Thanks for the helping from Kjteng, Millerw, Matvey.

Ye Chen
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.