Every so often, I come across some utility that need. I think it
must have been written before, but I can't find it.
Today I needed a tool to take a set of files and split them up into directories in a size that will fit on DVDs. I wanted a tool that could either produce the minimum number of DVDs, or keep the files in order. I couldn't find one. So I wrote
datapacker.
datapacker is a tool to group files by size. It is perhaps most often used to fit a set of files onto the minimum number of CDs or DVDs.
datapacker is designed to group files such that they fill fixed-size containers (called "bins") using the minimum number of containers. This is useful, for instance, if you want to archive a number of files to CD or DVD, and want to organize them such that you use the minimum possible number of CDs or DVDs.
In many cases, datapacker executes almost instantaneously. Of particular note, the hardlink action can be used to effectively copy data into bins without having to actually copy the data at all.
datapacker is a tool in the traditional Unix style; it can be used in pipes and call other tools.
I have, of course, uploaded it to sid. But while it sits in NEW, you can download the source tarball (with debian/ directory) from the project homepage at
http://software.complete.org/datapacker. I've also got an
HTML version of the manpage online, so you can see all the cool features of datapacker. It works nicely with find, xargs, mkisofs, and any other Unixy pipe-friendly program.
Those of you that know me will not be surprised that I wrote datapacker in Haskell. For this project, I added a
bin-packing module and support for parsing inputs like
1.5g to
MissingH. So everyone else that needs to do that sort of thing can now use library functions for it.
Update... I should have mentioned the
really cool thing about this. After datapacker compiled and ran, I had only
one mistake that was not caught by the Haskell compiler: I said < where I should have said <= one place. This is one of the very nice things about Haskell: the language lends itself to compilers that can catch so much. It's not that I'm a perfect programmer, just that my compiler is pretty crafty.
Comments
Thu, 15.05.2008 05:01
In general, it is impossible t o prove that something is rand om, and difficult to ascertain that something is suffi [...]
Thu, 15.05.2008 00:24
There should be testing of pat ched programs before they are released, when feasible. This bug could have been caug [...]
Wed, 14.05.2008 16:58
Sure, it's only modifiable if it's a pointer... but pointers are the only practical way to pass many things: strin [...]
Wed, 14.05.2008 16:47
"Especially since you may be d ealing with functions that cal l other functions 5 deep, and one of those functions m [...]
Wed, 14.05.2008 16:22
Imagine that you are knowingly breaking the law by not apply ing for the appropriate visas. Not only that, but you [...]
Tue, 13.05.2008 18:59
I have heard that argument bef ore, and frankly, I'm unconvin ced. I am not aware of any Am erican jurisdiction wher [...]
Tue, 13.05.2008 18:55
What a wonderful point and pos t. You're quite right, and it 's high time we all revisit th e notion that legality d [...]
Tue, 13.05.2008 18:52
Quite right. Article fixed ab ove.