K.Mandla's blog of Linux experiences

hoz: Take it apart, put it together

I picked up another small console tool yesterday — hoz, a file splitter that hasn’t seen any work in a few years, but is still quite usable.

File splitters used to be must-have utilities for me. Nowadays I have to admit that — with the proliferation of high-speed Internet connections, gigabyte flash drives, large file hosting sites and even e-mail that accepts megabyte-size attachments — splitting things and copying them on to floppies to be reassembled on another computer. … Well, I’ll just say I haven’t done that in a while.

I can still see where it might be useful though, in the case of something like splitting an ISO for uploading, or a movie for e-mailing. Regardless of the use, it was interesting to tinker with this one and watch it work.

The last rendition was 1.65, which is unfortunately 5 years old and could still use a little polishing around the edges. The size option for kilobytes and megabytes, for example, didn’t seem to be working for me. I could ask hoz to split things into clumps of a particular size, but I had to convert the the size to bytes before it would work; my “M” and “K” tags were ignored. Probably it was my mistake, although I did look at the source code and see if I was doing it right. (It’s worth noting that there’s also an option for gigabytes in the code, but it’s been commented out.)

It would also be nice if hoz would prepend the numbering on split files with a zero-buffer, rather than just starting with “1”. Something like “iso.001″, “iso.002″ and so forth sorts nicer in the ls output; “iso.1″ and so forth get thrown around in the list.

Those are minor points though, and neither impedes function. Much more important is that hoz gave me picture-perfect splitting and splicing: I checked the md5sum on a random ISO, split it into about 12 pieces, then reassembled it and got the same results both times. And that’s what’s key.

Apparently there’s a GUI version available in the source code, and judging by screenshots around the Web it’s fairly straightforward. From the console it’s quick and easy to handle, and does things right. If you need a quick file cutter and reassembler, whatever the reason, this one will do it.