Neil Stansbury wrote:
I am trying to get to an nsILocalFile in an installed extension. The only thing I know is it's GUID and chrome URI.

Can I ask why you're trying to do this? In the future, the installed location of extension files may change. You should also not be storing "persistent" data files in the extension directory. Keep the persistent datafile in <profiledir>/myextension.txt or some other arbitrary place that you decide and can maintain. If you're using only small bits of RDF, you can also keep information directly in the localstore RDF datasource.


Is it acceptable to:

var f = nsIProperties.get( 'ProfD',Components.interfaces.nsILocalFile );
f.append( "extensions/{GUID}/defaults/file.foo" );

In any case, you cannot append the entire path all at once and have it work on all platforms. You want to append each path-part independently:


var dirservice = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties);

var f = dirservice.get('ProfD', Components.interfaces.nsILocalFile);
f.append("extensions");
f.append("{GUID}");
f.append("defaults");
f.append("file.foo");

--BDS
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to