docs: function listTree(basePath, guard) {
      basePath = path.resolve(basePath);
  
      return stat(basePath).then(
          function(topStat) {
              var results = [];
              if (!guard || guard(basePath, topStat)) {
                  results.push(basePath);
              }
  
              if (topStat.isDirectory()) {
  
                  return list(basePath).then(
                      function(items) {
                          return Q.all(items.map(
                              function(item) {
                                  var fullPath = path.join(basePath, item);
                                  return listTree(fullPath, guard);
                              }
                          ));
                      }
                  ).then(
                      function(sets) {
                          return Array.prototype.concat.apply(results, sets).sort();
                      }
                  );
              }
              
              return results;
          },
          function() {
              // not found or not accessible, so the list is empty
              return [];
          }
      );
  
  }