code: function generateMode(nodeType, modePermissions) {
    switch(nodeType) {
    case NODE_TYPE_DIRECTORY:
      return (modePermissions || DEFAULT_DIR_PERMISSIONS) | S_IFDIR;
    case NODE_TYPE_SYMBOLIC_LINK:
      return (modePermissions || DEFAULT_FILE_PERMISSIONS) | S_IFLNK;
    case NODE_TYPE_FILE:
      // falls through
    default:
      return (modePermissions || DEFAULT_FILE_PERMISSIONS) | S_IFREG;
    }
  }
docs: Generate a POSIX mode (integer) for the node type and permissions.
  Use default permissions if we aren't passed any.