View Single Post
Old 08-21-2009, 05:22 PM   #310
vbu
Junior Member
vbu began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jun 2008
Device: Sony PRS-505
Hi,

Me again I went ahead and installed Firefox 3.5.2 and found a bug when bookit tries to create temp folders.

This is the code as is (file is modules/BookitConversion.js):
Code:
    getWorkingDir: function() {

        var workingDir = Components.classes["@mozilla.org/file/directory_service;1"]
                        .getService(Components.interfaces.nsIProperties)
                        .get("TmpD", Components.interfaces.nsIFile);
        workingDir.append("bookit-work");
        workingDir.createUnique(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0666);
        return workingDir;
    },
the call to createUnique has the wrong permissions for a folder. To get it to work I had to set the permissions to 0776. If I leave the permissions as is, the code creates the folder but then can't open it as the execute bit isn't set. Trying to open the folder via a terminal gives me a 'Permission denied' error. Once I changed the permissions then Bookit successfully ran web2disk and loaded the file into calibre.

This is on Ubuntu Jaunty Jackalope 9.0.4.

BTW, I still have firefox 3.0.13 installed and found that the TmpD variable isn't set so the following always fails:

Code:
 .get("TmpD", Components.interfaces.nsIFile);
HTH

Ver
vbu is offline   Reply With Quote