Skip to content

Tags: lesiw/fs

Tags

v0.14.0

Toggle v0.14.0's commit message
path: Drop always-true protoEnd guards in Split, Clean, and volume

All three sites are inside a style.kind == styleURL branch, which
only holds when detectStyle found "://" at index > 0. Neither Split
nor Clean mutates path in a way that removes "://" beforehand — the
local-prefix strip peels ./ or .\, which cannot overlap with :// given
that the prefix's second character is a separator, not a colon.
volume is called from Rel and segments, both of which pass a
detectStyle-classified path directly. strings.Index(path, "://") is
always non-negative here; the else arm in Clean is unreachable and
the wrapping ifs in Split and volume are dead.

v0.13.0

Toggle v0.13.0's commit message
context: Add WithoutWorkDir

Clearing the working directory previously had no expression:
WithWorkDir composed relative paths, so an empty dir joined onto the
existing directory and left it in place. WithoutWorkDir clears it
explicitly, like context.WithoutCancel, and WithWorkDir documents
the empty dir as a no-op.

v0.12.0

Toggle v0.12.0's commit message
buffer: Route init() through Create/Append helpers

bufferWriter.init() called CreateFS.Create/AppendFS.Append directly,
so CreateBuffer and AppendBuffer skipped the package-level dispatch
for trailing-slash tar streaming, path localization, parent directory
creation, and the Append read-rewrite fallback.

v0.11.0

Toggle v0.11.0's commit message
memfs: implement SymlinkFS and ReadLinkFS

Add symlink support to the in-memory filesystem. The node struct
gains a target field for storing link destinations. Path resolution
follows symlinks in intermediate components and optionally at the
final component, with a depth limit of 255 to prevent cycles.

v0.9.0

Toggle v0.9.0's commit message
path: Fix inaccurate doc comments

Fix Join examples that showed "foo/bar" instead of "./foo/bar" (Clean
adds local prefix to relative paths). Remove incorrect claim that Rel
calls Clean on its result.

v0.8.0

Toggle v0.8.0's commit message
path: add Rel for computing relative paths

Rel computes a relative path from basepath to targpath, following the
same multi-style approach as Clean and Join. Handles Unix, Windows
drive letters, and URL protocol/host volumes with proper comparison
and separator detection.

Adds segments and volume helpers to support hierarchy comparison and
volume extraction.

v0.10.0

Toggle v0.10.0's commit message
memfs: implement AbsFS and fix absolute path resolution

memfs is inherently rooted but never declared AbsFS. Add Abs()
that prepends "/" to resolved paths.

Fix resolvePath to skip WorkDir prepending for absolute paths,
matching osfs behavior. Without this guard, operations like Stat
with absolute paths incorrectly have WorkDir prepended, breaking
patterns like find-up that walk the directory tree with absolute
paths while WorkDir is set.

Thanks to @calvinhtr for finding the resolvePath bug.

Apply the same fix to HTTP and S3 filesystem implementations,
using lesiw.io/fs/path to detect absolute URL paths.

Add FindUp test to fstest that exercises this contract across
all filesystem types including URL-based ones.

v0.7.0

Toggle v0.7.0's commit message
memfs: implement AbsFS and fix absolute path resolution

memfs is inherently rooted but never declared AbsFS. Add Abs()
that prepends "/" to resolved paths.

Fix resolvePath to skip WorkDir prepending for absolute paths,
matching osfs behavior. Without this guard, operations like Stat
with absolute paths incorrectly have WorkDir prepended, breaking
patterns like find-up that walk the directory tree with absolute
paths while WorkDir is set.

Thanks to @calvinhtr for finding the resolvePath bug.

Apply the same fix to HTTP and S3 filesystem implementations,
using lesiw.io/fs/path to detect absolute URL paths.

Add FindUp test to fstest that exercises this contract across
all filesystem types including URL-based ones.

v0.6.0

Toggle v0.6.0's commit message
appendDirAsTar: drain trailing data after tar extraction

The pipe fallback in appendDirAsTar closes the reader immediately after
extractTarToFS returns. If the tar source has trailing zero-byte padding
(e.g. git archive pads to 10KB block boundaries), the unread bytes
cause io.ErrClosedPipe on the writer side.

Drain remaining pipe data after extraction completes. Also refactor the
CreateDir fstest into a table-driven test covering both basic and padded
tar streams.

v0.5.0

Toggle v0.5.0's commit message
Walk: Localize path