code: func CreateTorusRoot(checkPermissions bool) (string, error) {
  	torusRoot := torusRootPath()
  	src, err := os.Stat(torusRoot)
  	if err != nil && !os.IsNotExist(err) {
  		return "", err
  	}
  
  	if err == nil && !src.IsDir() {
  		return "", fmt.Errorf("%s exists but is not a dir", torusRoot)
  	}
  
  	if os.IsNotExist(err) {
  		err = os.Mkdir(torusRoot, requiredPermissions)
  		if err != nil {
  			return "", err
  		}
  
  		src, err = os.Stat(torusRoot)
  		if err != nil {
  			return "", err
  		}
  	}
  
  	fMode := src.Mode()
  	if checkPermissions && fMode.Perm() != requiredPermissions {
  		return "", fmt.Errorf("%s has permissions %d requires %d",
  			torusRoot, fMode.Perm(), requiredPermissions)
  	}
  
  	return torusRoot, nil
  }
docs: // CreateTorusRoot creates the root directory for the Torus daemon.