4 Commits
Author SHA1 Message Date
dualfroz e548a44b67 Describe this repository 2026-10-22 21:07:19 +02:00
dualfroz c37cd819a9 fix: return an error instead of panicking on orphaned MemMapFs Remove
unRegisterWithParent called log.Panic when a file's parent directory was
no longer registered (for example when the parent was removed first),
crashing the whole program from an ordinary Remove call. Return a normal
error instead so Remove, RemoveAll and Rename can surface it to the
caller. The now-unused log import is dropped.

Fixes #388
2026-09-02 11:40:32 +02:00
dualfroz b778e8e78b fix: strip nested BasePathFs base segment from BasePathFile.Name
BasePathFile.Name trimmed only filepath.Clean(path) from the wrapped
file name. filepath.Clean drops the trailing separator, and a nested
BasePathFile reports a name whose base segment is preceded by a leading
separator (for example "/123/x"), which the cleaned base ("123") does
not match. The base then leaked into Name and callers double-prepended
it. Trim the separator-prefixed form too so nested BasePathFs report a
name that round-trips.

Fixes #428
2026-09-02 11:39:06 +02:00
dualfroz afcb7e66f3 fix: only enforce O_EXCL on MemMapFs OpenFile when O_CREATE is set
Per POSIX, O_EXCL is meaningful only together with O_CREATE. MemMapFs
OpenFile returned ErrFileExists whenever O_EXCL was set on an existing
file, so reopening a file with O_RDWR|O_EXCL failed even though no
creation was requested. Guard the existence check with O_CREATE so that
O_EXCL without O_CREATE opens the existing file, matching os.OpenFile.

Fixes #415
2026-09-02 11:37:36 +02:00