mozdev.org

JSLib
Page Updated: March 11, 2005
Latest Version: 0.1.375
Debug | Install | File I/O | RDF | Network | Sound | Utils | XUL | Zip
Home | Mailing List | Install | Source Code | Downloads | Bugs | docs | clients
STATUS: up to date

JS Directory Class API


Function List

  • help;
  • Examples: (using xpcshell) js> load('chrome/jslib/jslib.js'); ********************* JS_LIB DEBUG IS ON ********************* js> include('chrome://jslib/content/io/dir.js'); *** load: filesystem.js OK *** load: dir.js OK true js> var d=new Dir('/tmp'); js> d.help; Function and Attribute List: initPath(aPath); path; exists(); leaf; parent; permissions; dateModified; nsIFile; move(aDest); append(aLeaf); appendRelativePath(aRelPath); isDir(); isFile(); isExec(); isSymlink(); create(aPermissions); remove(aRecursive); readDir(aDirPath); js> d.path; /tmp js> d.exists(); true js> d.leaf; tmp js> d.permissions; 777 js> d.isDir(); true js> d.isFile(); false js> d.append('PETE'); /tmp/PETE js> d.exists(); false js> d.create(); js> d.isDir(); true d.move('/tmp/PETE_MOVED'); PETE_MOVED filesystem.js:move successful! true js> d.path; /tmp/PETE_MOVED js> d.remove(true); js> d.initPath('/tmp'); /tmp js> d.path; /tmp js> var contents=d.readDir(); js> contents[0].path; /tmp/.X11-unix js> contents[0].isFile(); false js> contents[0].isDir(); true js> contents.length; 117 js> contents[116].path; /tmp/someNewFile.dat js> contents[116].size; 0 js> quit();

    The jslib project can be contacted through the mailing list or the member list.
    Copyright © 2000-2017. All rights reserved. Terms of Use & Privacy Policy.