Jaxer.Dir

Utility object for filesystem directory access.

Constructor

var dir = new Jaxer.Dir(path);

Creates a new instance for performing filesystem directory operations.

Properties

  • Jaxer.Dir.dateModified
  • The last modified timestamp as reported by the OS.

  • Jaxer.Dir.exists
  • A boolean indicator of whether the referenced object physically exists on the filesystem.

  • Jaxer.Dir.isDir
  • A boolean indicator of whether the referenced object is a folder/directory.

  • Jaxer.Dir.isExec
  • A boolean indicator of whether the referenced object is an executable.

  • Jaxer.Dir.isFile
  • A boolean indicator of whether the referenced object is a file.

  • Jaxer.Dir.isFolder
  • A boolean indicator of whether the referenced object is a folder/directory an alias of as isDir.

  • Jaxer.Dir.isHidden
  • A boolean indicator of whether the referenced object is hidden.

  • Jaxer.Dir.isReadable
  • A boolean indicator of whether the referenced object is readable.

  • Jaxer.Dir.isSpecial
  • A boolean indicator of whether the referenced object is special.

  • Jaxer.Dir.isSymlink
  • A boolean indicator of whether the referenced object is a symlink.

  • Jaxer.Dir.isWritable
  • A boolean indicator of whether the referenced object is writable.

  • Jaxer.Dir.leaf
  • Get/Set the leaf (filename + extension) portion of the file path.

  • Jaxer.Dir.path
  • Returns the path of the refererenced filesystem object.

    Methods

  • Jaxer.Dir.prototype.clone();
  • none

    Jaxer.Dir

    Clone a directory object

  • Jaxer.Dir.prototype.contains(file);
  • <Jaxer.File> file - Jaxer File object or string

    Boolean

    Tests whether a file Object exists in the Physical directory referenced by the Dir object

  • Jaxer.Dir.prototype.create(permissions);
  • <String> permissions - The permissions used to create the filesystem object.

    null

    Creates a new folder under the referenced path of the directory object The format of the permissions is a unix style numeric chmod i.e. 0777 or 444 on Windows, you can only set the Read/Write bits of a file. And User/Group/Other will have the SAME settings based on the most-relaxed setting (Read 04, 040, 0400, Write 02, 020, 0200). When a file is created, by default it has both Read and Write permissions. Also, you cannot set the file permission to WRITE-ONLY, doing so would set it to read-write.

  • Jaxer.Dir.prototype.createHierarchy(permissions);
  • <String> permissions - The permissions used to create the filesystem object.

    null

    Creates a hierarchy of folders as needed to contain the current folder's path. The format of the permissions is the same as for the create method.

  • Jaxer.Dir.prototype.readDir();
  • none

    <Jaxer.Filesystem[]> - an Array of Filesystem Objects, with no sort order explicitly set.

    Read the contents of a directory.

  • Jaxer.Dir.prototype.remove(recursive);
  • <Boolean> - True/False value to indicate whether the removal includes subfolders.

    null

    Removes specified folder from the file system.

  • Jaxer.Dir.prototype.exists(path);
  • <String> - The full or partial (to be resolved) path to test

    <Boolean>

    Does the directory exist on disk? Returns true if exists, false otherwise.