Sans Browser

Archives Posts

XULRunner File Remove Bug and Work-around

January 12th, 2009 by enefekt

I’m working on a tool based on XULRunner that generates some content. (HTML content, images, etc.) It produces a directory to put the content into, and then offers the user the option of viewing that content right away.

The problem lies in leaving that content open in a another application like a web browser. Upon returning to the tool, and attempting to re-publish the content, an NS_ERROR_FAILURE exception is thrown coming from the nsIFile.remove call to remove the directory recursively. This is because of some sort of file exclusivity the web browser process has already.

So easy, just catch that error, inform the user to close their content in any other open application, rinse and repeat, right? Well unfortunately under XULRunner on Mac OS 10.5, the initial failure gunks up any further attempts. So even reinitializing a new nsIFile instance doesn’t work. Only restarting the app works! Yech.

Well I found that manually doing a recursive loop and removing each file individually, and then removing the parent directory, works. Definitely not efficient, as the native code would be better over JavaScript. (TraceMonkey should help with this right?) But there isn’t a grossly high number of files or that deep of a hiearchy anyways.

So meanwhile over on Windows, that technique throws it’s own lovely exception. But on Windows, catching the initial exception, and warning the user about files open in other application and closing them, works fine, so thats what I’m using over there.

Archives Posts

The Bitter Taste of Tamarin or Launch of the JavaScript Wars?

September 30th, 2008 by enefekt

I’ve been trying to at the very least write one post a month, so I’m going to sneak my September in here.

I always thought the Tamarin project was a nice example of an open-source move by Adobe. The JS-Harmony project definitely threw some cold water on some idealistic visions.

This Reg article apparently cites some bitterness at least for one person at Adobe regarding the fruitions of the open source contributions.

I’ll tell you what I think, that Adobe’s contribution helped stoke the JavaScript wars we’re seeing right now. And no matter how much Tamarin is sliced and diced, I think many will benefit from it.

Archives Posts

Mozilla TraceMonkey: Adobe Open-Source Fruit

August 25th, 2008 by enefekt

I’m not trying to maximize or minimize any specific roles in this first release of Mozilla’s new JavaScript engine, but it’s cool to see the shout out on Brendan’s post:

“I’m also grateful to Ed Smith and the Tamarin Tracing team at Adobe for the TT Nanojit, which was a huge boost to developing TraceMonkey.”

Really neat to see Adobe’s contributions helping to make such an impact, wish we could see more collaboration between Mozilla and Adobe.

ok2