[Jslib] A bug?

Brian King brian at mozdev.org
Mon May 23 13:43:38 EDT 2005


Try the following code:

var xdirs = new DirUtils();
var xfs = new Dir(xdirs.getMozUserHomeDir());
xfs.append("boxman");
if (!xfs.exists())
   xfs.create()
this.root_dir =  xfs;

var rdfFile = new File(xfs.path);
rdfFile.append("device.rdf");
this.device_file = rdfFile.path;
this.device_ds = new RDFFile(this.device_file, 0, g_boxman_ns,
                              "boxman");

Wei Wang wrote:
> Greetings,
> 
> I am posting this just in case someone can find the problem faster than I:
> 
> In trying to read the following RDF file using RDFFile (The file name is 
> line-wrapped because of spaces in the path) I got some exceptions that 
> jslib has reported as shown below:
> 
> 
> 
> C:\Documents and Settings\weiwang\Application 
> Data\Mozilla\Firefox\Profiles\default.4hp\boxman\device.rdf
> 
> 
> 
> -----======[ jsLib ERROR ]=====-----
> FileName:          chrome://jslib/content/io/filesystem.js
> Result:            -2152398858
> Message:           Component returned failure code: 0x804b000a 
> [nsIURL.spec]
> LineNumber:        82
> -------------------------------------
> 
> NS_ERROR_NOT_INITIALIZED
> NS_ERROR_NOT_INITIALIZED
> 
> -----======[ jsLib ERROR ]=====-----
> FileName:          chrome://jslib/content/rdf/rdfFile.js
> Result:            -2153185289
> Message:           Could not convert JavaScript argument arg 0 
> [nsIIOService.newFileURI]
> LineNumber:        90
> -------------------------------------
> 
> 
> 
> 
> The code:
> 
> var xdirs = new DirUtils();
> var xfs = new FileSystem(xdirs.getMozUserHomeDir());
> xfs.appendRelativePath("boxman");
> xfs.mkdir();
> this.root_dir =  xfs;
> 
> this.device_file = "file://" + xfs.path + "/device.rdf";
> this.device_ds = new RDFFile(this.device_file, 0, g_boxman_ns,
>                              "boxman");
> 
> 
> 
> 
> Just a thought: Could (xfs.path + "/device.rdf") be the problem?
> 
> Regards,


-- 
Brian King
www.mozdev.org - free project hosting for the Mozilla community


More information about the Jslib mailing list