![]() ![]() With that information, it would then be possible to decide which files should be grouped together by any of the standard approaches to the Knapsack Problem and create the actual zip files.Īssuming you have a scripting language available to you and you know how to use it, I would expect this approach to be fairly straightforward to automate doing it manually would be quite tedious if you have more than a handful of files to deal with.ĭave seemed to provide the closest programmable solution to what OP requested. If I were presented with this problem, I suppose I would start out by compressing each file individually to a temporary location (or in memory, without writing them to disk), just so that I could get an approximate compressed size for each. ![]() The trivial solution, of course, would be to simply zip each file independently, but that fails to reduce the file count any, so I suspect it would not be a satisfactory solution. What you're proposing is essentially a variation of the Knapsack Problem, with the added twist that, due to file compression, you don't start off knowing how much of your 20MB "knapsack" each item will occupy.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |