Zip Writer

One of the annoying omissions from the Mozilla platform has always been the inability to create a zip file. It’s been bugging me for some time since it’s the only way for Nightly Tester Tools to properly manage overriding compatibility for an individual extension install, without doing dangerous things like it used to. There’s been a Google Summer of Code project on creating such functionality but it didn’t get all that far.

Well Saturday night I finally bit the bullet, after talking about it for a long time, and took a crack at it myself. I didn’t like the API’s presented in the SoC project so I decided to just start from scratch andknock up something really really simple. And when I say simple, I mean that initially all this thing was going to do was create a zip file (no editing existing ones), and add files and folders to it, with no compression. That makes it simple see, just add a few file headers here and there and all you’re doing is copying data around.

Rather surprisingly it almost worked. Lots of problems handling CRC calculations in JavaScript, but got there in the end. Well to a point. It managed to write out zip files when the files added were not too binary in nature. I made the mistake of attempting all this in JavaScript which it turns out doesn’t work with binary data too well. Particularly not when the Mozilla interfaces I used pass then around as char* data types which js then turns into a unicode string.

So onto the second implementation in C++ this time. I guess it was probably inevitable that it would come to it, but JS at least is real quick to prototype things like this in. The C++ implementation now works as well as I’d initially hoped, so since then I’ve of course got bored and started looking into having real compression in there and maybe editing zip files in the future. Like most of my code all this is open source, you can view it in my subversion repository. What’s more, since I moved on, Mook has taken the JS implementation, plumbed in some cleverness and made it work for binary files too!

Obviously the code is to be used at your own risk and right now it’s not all that thoroughly tested. Hopefully though if I can convince bsmedberg of my API’s, this code might end up making it onto trunk so everyone can use it.

Muppet Parade

Yes I am shamelessly adding new posts in an attempt to make the front page look something other than sparse, well sort of…

Anyone who read my homepage for about the past year will remember some idiot sending me a pointlessly rude email. Well coincidentally it happened again so I thought I’d share this one as well. Now remember that (due to my shameless neglect to do anything about it) when people fill in the contact form on my site, I have absolutely no clue where they are coming from or quite often what they are talking about:

From: beeotch

Comments: wtf is ur problem. put what the extension dus u sonofabitch

Oh I so enjoy some of the messages people send me.

No seriously most of the people that contact me are great, a couple though really need to remember that I write these things in my spare time and don’t charge a bean for them. As you should remember for the majority of extension authors.

First Post!

Well here we are, the first post of what I'm trying my best not to call a blog, since I secretly snigger at my friends who have blogs.

For those of you new to this site, welcome, for those returning, check out the spiffy new look, ain't it thousands of times better than it was! There's still a bit of work to do, improving the information on my extensions and such but my website has always been a bit of a work in progress.

So I should say that this won't be much of an interesting blog unless you are particularly interested in Mozilla related stuff. I don't intend to write about my personal feelings (apparently I have them) and I'll be keeping rants about news/stuff to a minimum.

Displaying posts by tag and getting feeds for tags is in the pipeline, so hang tight and I'll post here when that sort of gubbins is done.