[
  {
    "Id": "552943",
    "ThreadId": "242686",
    "Html": "\r\n<p>Greetings....</p>\r\n<p>I am writing a backup program in c# 3.5.&nbsp; The basics of the program is to be given a location on a server and the max size of a spanned zip file and go. From there it should traverse all the folder/files from the given location and add them to the archive,\r\n keeping the exact structure. It should also compress everything down to&nbsp;a reasonable amount. A given &quot;collection&quot; of folders/files could easily be 10-25gb, while the spanned files would probably be about 1gb each.</p>\r\n<p>I have everything working (using DotNetZip). My only challenge is there is little to no compession actually happening. I chose to use the &quot;AddDirectory&quot; method for simplicity of code and just generally how well it seemed to fit my project. After reading\r\n around I am second guessing that decision.</p>\r\n<p>1. Given the below code and the large amount of files in an archive, should I compress each file as it is added to the zip? or should the Adddirectory method provide about the same compression?</p>\r\n<p>2. I have tried every level of compression offered by Ionic.Zlib.CompressionLevel and none seem to help. Should I think about using an outside compression algorithm and stream it into my DotNetZip file?</p>\r\n<div style=\"color:black; background-color:white\">\r\n<pre><span style=\"color:blue\">using</span> (ZipFile zip = <span style=\"color:blue\">new</span> ZipFile())\r\n{\r\n  zip.AddDirectory(root.FullName);\r\n\r\n  <span style=\"color:blue\">if</span> (zipPassword.Length &gt; 0)\r\n    zip.Password = zipPassword;\r\n\r\n  <span style=\"color:blue\">float</span> size = zipGbSize * 1024 * 1024 * 1024;\r\n\r\n  zip.CompressionLevel = Ionic.Zlib.CompressionLevel.BestCompression;\r\n  zip.AddProgress &#43;= <span style=\"color:blue\">new</span> EventHandler&lt;AddProgressEventArgs&gt;(Zip_AddProgress);\r\n  zip.ZipError &#43;= <span style=\"color:blue\">new</span> EventHandler&lt;ZipErrorEventArgs&gt;(Zip_ZipError);\r\n  zip.Comment = <span style=\"color:#a31515\">&quot;This zip was created at &quot;</span> &#43; System.DateTime.Now.ToString(<span style=\"color:#a31515\">&quot;G&quot;</span>);\r\n  zip.MaxOutputSegmentSize = (<span style=\"color:blue\">int</span>)size;   <span style=\"color:green\">//in gig</span>\r\n  zip.Name = archiveDir.FullName &#43; <span style=\"color:#a31515\">@&quot;\\Task_&quot;</span> &#43; taskId.ToString() &#43; <span style=\"color:#a31515\">&quot;.zip&quot;</span>; <span style=\"color:green\">//from the current dir, put the zips in the archive dir</span>\r\n\r\n  zip.Save();\r\n}\r\n</pre>\r\n<pre>Thank you for any help!</pre>\r\n</div>\r\n",
    "PostedDate": "2011-01-20T18:58:13.623-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "559676",
    "ThreadId": "242686",
    "Html": "\r\n<p>I can't offer a solution but I do have a question. &nbsp; &nbsp;Does the zip file produced using your code actually require a password when you extract it?<br>\r\n<br>\r\nIf I add individual files to the zip I can get the password functionality to work however, It does not work when I use the AddDirectory method.</p>\r\n",
    "PostedDate": "2011-02-02T12:56:00.687-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "559683",
    "ThreadId": "242686",
    "Html": "\r\n<div>\r\n<p><span style=\"font-size:11.0pt; font-family:\">Actually I never used the password functions. I know it’s in my code but those values are all being taken from a database. I have honestly never tested.</span></p>\r\n<p><span style=\"font-size:11.0pt; font-family:\"></span></p>\r\n<div>\r\n<div style=\"border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0in 0in 0in\">\r\n<p><b><span style=\"font-size:10.0pt; font-family:\">From:</span></b><span style=\"font-size:10.0pt; font-family:\"> MightyAC [email removed]\r\n<br>\r\n<b>Sent:</b> Wednesday, February 02, 2011 3:56 PM<br>\r\n<b>To:</b> david@entellect.biz<br>\r\n<b>Subject:</b> Re: Best way to compress large archive of files [DotNetZip:242686]</span></p>\r\n</div>\r\n</div>\r\n<p></p>\r\n<p><span style=\"font-size:9.0pt; font-family:\">From: MightyAC</span></p>\r\n<div id=\"x_x_ThreadNotificationPostBody\" style=\"margin-bottom:24.0pt\">\r\n<p><span style=\"font-size:9.0pt; font-family:\">I can't offer a solution but I do have a question. Does the zip file produced using your code actually require a password when you extract it?<br>\r\n<br>\r\nIf I add individual files to the zip I can get the password functionality to work however, It does not work when I use the AddDirectory method.</span></p>\r\n</div>\r\n</div>\r\n",
    "PostedDate": "2011-02-02T13:06:59.457-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]