if (typeof(JS_LIB_LOADED)=='boolean') { const JS_FILESYSTEM_LOADED = true; const JS_FILESYSTEM_FILE = "filesystem.js"; const JS_FS_LOCAL_CID = "@mozilla.org/file/local;1"; const JS_FS_NETWORK_CID = '@mozilla.org/network/standard-url;1'; const JS_FS_URL_COMP = "nsIURL"; const JS_FS_File_nsIFile = new Components.Constructor (JS_FS_LOCAL_CID, "nsILocalFile", "initWithPath"); const JS_FS_URL = new Components.Constructor (JS_FS_NETWORK_CID, JS_FS_URL_COMP); /* DEPRECATED! */ const JS_FS_File_Path = JS_FS_File_nsIFile; const JS_FS_INIT_W_PATH = "initWithPath"; const JS_FS_I_LOCAL_FILE = "nsILocalFile"; const JS_FS_CHROME_DIR = "AChrom"; const JS_FS_PREF_DIR = "PrefD"; const JS_FS_USR_DEFAULT = "DefProfRt"; const JS_FS_DIR_I_PROPS = "nsIProperties"; const JS_FS_DIR_CID = "@mozilla.org/file/directory_service;1"; const JS_FS_Dir = new Components.Constructor (JS_FS_DIR_CID, JS_FS_DIR_I_PROPS); /* END DEPRECATED! */ /** * FileSystem Object Class */ function FileSystem (aPath) { if (aPath < 0) return jslibErrorMsg("NS_ERROR_INVALID_ARG"); // support nsIFile method names this.isExecutable = this.isExec; this.isDirectory = this.isDir; this.initWithPath = this.initPath; this.moveTo = this.move; this.copyTo = this.copy; return (aPath?this.initPath(arguments):JS_LIB_VOID); } /** * FileSystem Prototype */ FileSystem.prototype = { mPath : null, mFileInst : null, /** * INITPATH */ initPath : function (args) { // check if the argument is a file:// url var fileURL; if (jslibTypeIsObj(args)) { for (var i=0; i1) for (i=1; i