code: func (d *fsDest) prepareFilePath(ctx context.Context, name string) (string, error) {
  	path := filepath.Clean(filepath.Join(d.dest, filepath.FromSlash(name)))
  	if !IsSubpath(path, d.dest) {
  		return "", fmt.Errorf("invalid relative file name: %s", name)
  	}
  	if _, err := d.fs.EnsureDirectory(ctx, filepath.Dir(path)); err != nil {
  		return "", err
  	}
  	return path, nil
  }
docs: // prepareFilePath performs steps common to CreateFile and CreateSymlink.
  //
  // It does some validation, expands "name" to an absolute path and creates
  // parent directories for a future file. Returns absolute path where the file
  // should be put.