seedLink method

void seedLink(
  1. String path,
  2. String target
)

Creates a symbolic link at path pointing at target, replacing whatever sits there.

A target starting with / is absolute; anything else resolves against the directory holding the link.

Implementation

void seedLink(String path, String target) {
  final String normalized = _normalize(path);
  _seedAncestorsOf(normalized);
  _files.remove(normalized);
  _directories.remove(normalized);
  final String parent = _parentOf(normalized) ?? _root;
  _links[normalized] = target.startsWith('/')
      ? _normalize(target)
      : _normalize('$parent/$target');
}