Home » Blog
date 10.Nov.2013

■ Not your everyday file management: optimal file packing

xplorer² has many commands you probably never used and wondered what the heck they stand for. One of them is Mark > Total size, which automatically selects files that add up to a desired size, say 400MB. Why would you want such a feature? Perhaps you are trying to solve a combinatorial problem called Knapsack and you are not aware of it?

The other day I was just in that situation. For one reason or other I wanted to transfer a large music collection from one PC to another and all I had available was a rusty old USB stick with 400MB free space, not enough to hold all the MP3 files in one go. Using the synthetic a priori toolset in xplorer² here's how I dealt with it:

  1. put the music folders in a scrap container for handling
  2. calculate their sizes using Tools > Subfolder size menu command
  3. grab a batch of folders approaching 400MB in size
  4. copy the batch in the USB, move it to the other computer, delete the USB contents
  5. remove the selected folders from the miniscrap
  6. repeat from step 3 until all the folders are transferred

Mark > Total size command comes handy in step 3. Instead of manually adding up sizes, we let xplorer² select items totalling the desired size. It is a greedy selection algorithm, and not really combinatorial optimization, but it works. So next time you want to transfer files and you don't have wifi or a network cable, you will be glad you read this blog post <g>

Here is a demo video: play

Post a comment on this topic »

Share |

©2002-2013 ZABKAT, all rights reserved | Privacy policy | Sitemap