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
Sun, 05.10.2008 20:40
There is no denying that there have been plenty of people th at have killed in the name of Christianity. That does [...]
Sun, 05.10.2008 18:34
I think the formula you wanted is git format-patch $(git rev-list HEAD | tail -1)
Sun, 05.10.2008 14:23
I know it sounds nice to you, but, Christianity means an opp ressive, theocratic, brutal, b loody regime to many of [...]
Sat, 04.10.2008 23:47
I agree that there must be sen sible limits on government exp enditure, for sure. Healthc are is one of those wher [...]
Sat, 04.10.2008 23:43
Not at all, and I completely a gree with you. But I wanted to stress that part, because not everyone does.
Sat, 04.10.2008 23:41
Hi Cliff, I agree with you that the "they take jobs Ameri cans won't" argument doesn't m ake sense. I also agree [...]
Sat, 04.10.2008 17:26
I always worry when people cla im their ethics are founded on religious tenets, since most religions have a lot of [...]
Sat, 04.10.2008 08:37
"We are torturing potentially innocent people." Are you i mplying that it's allowed to t orture "guilty" people? [...]