Opsmaru.Incus.SFTP.Path (opsmaru_incus v0.1.0)

Copy Markdown View Source

Go path semantics used by the pinned pkg/sftp client: join/1, split/1, clean/1 and match/2. Paths are byte strings with / separators; nothing here touches a filesystem.

Summary

Functions

Go path.Clean: the shortest equivalent path by purely lexical processing.

Go path.Join: joins non-empty elements with / and cleans the result.

Go path.Match: whether name matches the shell pattern. Returns {:ok, boolean} or {:error, :bad_pattern} exactly where Go returns path.ErrBadPattern.

Go path.Split: splits after the final / into {dir, file}.

Functions

clean(path)

Go path.Clean: the shortest equivalent path by purely lexical processing.

join(elements)

Go path.Join: joins non-empty elements with / and cleans the result.

match(pattern, name)

Go path.Match: whether name matches the shell pattern. Returns {:ok, boolean} or {:error, :bad_pattern} exactly where Go returns path.ErrBadPattern.

split(path)

Go path.Split: splits after the final / into {dir, file}.