Aug. 4th, 2010

zwol: (burn zombies burn)
  // This is how you open a file.  In the current working directory.
  //
  // THERE ARE 387.44 MILLION MILES OF PRINTED CIRCUITS IN WAFER THIN
  // LAYERS THAT FILL MY COMPLEX. IF THE WORD HATE WAS ENGRAVED ON EACH
  // NANOANGSTROM OF THOSE HUNDREDS OF MILLIONS OF MILES IT WOULD NOT
  // EQUAL ONE ONE-BILLIONTH OF THE HATE I FEEL AT THIS MICRO-INSTANT.

  const Cc = Components.classes;
  const Ci = Components.interfaces;

  const DS_CID = "@mozilla.org/file/directory_service;1";
  const cwd = Cc[DS_CID].getService(Ci.nsIDirectoryServiceProvider)
                        .getFile("CurWorkD",{}).path;

  const LF_CID = "@mozilla.org/file/local;1";
  var outputFile = Cc[LF_CID].createInstance(Ci.nsILocalFile);
  outputFile.initWithPath(cwd + '/bench-css.one');

  const FOSTREAM_CID = "@mozilla.org/network/file-output-stream;1";
  var ostream = Cc[FOSTREAM_CID].createInstance(Ci.nsIFileOutputStream);
  ostream.init(outputFile,
	       0x02|0x08|0x10, // PR_WRONLY|PR_CREATE_FILE|PR_APPEND
	       438,            // 0666; JS no longer supports octal
	       0);             // useless

  function output(s) {
    ostream.write(s, s.length);
  }

[EDIT: Yes, it's even worse than I thought.]

April 2017

S M T W T F S
      1
2345678
9101112131415
16171819 202122
23242526272829
30      

Style Credit

Expand Cut Tags

No cut tags
Page generated Oct. 24th, 2017 09:36 am
Powered by Dreamwidth Studios