Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/quota/test/modules/system/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 734 B image not shown  

Quelle  FileUtils.sys.mjs   Sprache: unbekannt

 
Spracherkennung für: .mjs vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

/**
 * Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/
 */

export const FileUtils = {
  getProfileDirectory() {
    return Services.dirsvc.get("ProfD", Ci.nsIFile);
  },

  getFile(relativePath, baseFile) {
    if (!baseFile) {
      baseFile = this.getProfileDirectory();
    }

    let file = baseFile.clone();

    if (Services.appinfo.OS === "WINNT") {
      const winFile = file.QueryInterface(Ci.nsILocalFileWin);
      winFile.useDOSDevicePathSyntax = true;
    }

    relativePath.split("/").forEach(function (component) {
      if (component == "..") {
        file = file.parent;
      } else {
        file.append(component);
      }
    });

    return file;
  },
};

[ Dauer der Verarbeitung: 0.29 Sekunden  ]