Home » Blog
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:
- put the music folders in a scrap container for handling
- calculate their sizes using Tools > Subfolder size menu command
- grab a batch of folders approaching 400MB in size
- copy the batch in the USB, move it to the other computer, delete the USB contents
- remove the selected folders from the miniscrap
- 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:
Post a comment on this topic »