code: func (root *Directory) listing(skipRoot bool) *DirList {
  	if root == nil {
  		return nil
  	}
  
  	// determine number of entries n and maximum height
  	n := 0
  	minDepth := 1 << 30 // infinity
  	maxDepth := 0
  	for d := range root.iter(skipRoot) {
  		n++
  		if minDepth > d.Depth {
  			minDepth = d.Depth
  		}
  		if maxDepth < d.Depth {
  			maxDepth = d.Depth
  		}
  	}
  	maxHeight := maxDepth - minDepth + 1
  
  	if n == 0 {
  		return nil
  	}
  
  	// create list
  	list := make([]DirEntry, n)
  	i := 0
  	for d := range root.iter(skipRoot) {
  		p := &list[i]
  		p.Depth = d.Depth - minDepth
  		p.Height = maxHeight - p.Depth
  		// the suffix is absolute, with the camlistore dir as the root
  		idx := strings.LastIndex(d.Path, domainName)
  		if idx == -1 {
  			log.Fatalf("No \"%s\" in path to file %s", domainName, d.Path)
  		}
  		suffix := pathpkg.Clean(d.Path[idx+len(domainName):])
  
  		p.Path = suffix
  		p.Name = d.Name
  		p.HasPkg = d.HasPkg
  		p.Synopsis = d.Synopsis
  		i++
  	}
  
  	return &DirList{maxHeight, list}
  }
docs: // listing creates a (linear) directory listing from a directory tree.
  // If skipRoot is set, the root directory itself is excluded from the list.
  //