Folder Compression

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can GZipStream class compress an entire directory not only a file?
If not, how to compress a directory?
Thanks.
 
Bishoy,

GZipStream works on data streams. You have at least two choices here.

1) This approach would require you to create a custom class which would
represent an archive where you can have foldrs and file information. This
would be the hard way to do our job but would be fun to do. The archive class
will hold either folder or file class objects. Obviously the folder class
will be capable of holding multiple compressed file steam data. You will need
to add logic to scan the given folder, iterate through it recursively to
compress the files and building a memory tree structure. Then we can
serialize this class object using BinaryFormater to be able to be
deserialized later on.

2) This would be to use open zip library like charpziplib which will make
you life much easier.

Go for 1) if you have sometime to work on this or go for 2) if you are too
late for experiments.

HTH

Siva
 
Back
Top