Commit graph

5 commits

Author SHA1 Message Date
vrubelroman
39e8264528 feat(vfs/localfs): freedesktop trash with topdir support (2A.4)
Items on another volume go to $topdir/.Trash/$uid (real, sticky .Trash only)
or $topdir/.Trash-$uid instead of failing with EXDEV (N-P2-12). The
.trashinfo is reserved with O_EXCL (collisions get a .N suffix and skip
orphans in files/), Path= is URL-encoded, DeletionDate is local time, and
under sudo the effective user's trash is used. The old UI's MoveToTrash now
delegates here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:28:31 +03:00
vrubelroman
9d5b6bf0c4 test(vfs/vfstest): conformance suite and FaultFS; run it on localfs (2A.3)
vfstest.Run checks any writable vfs.FS through the API only (so it also runs
over SFTP): Lstat/Stat/ReadDir with symlinks, Create Excl/Trunc, ReadAt,
Mkdir, Rename in both modes, Remove (file, link, empty and non-empty dir),
RemoveTree on a link to a directory, Chmod/Chtimes, RealPath, Sync and the
error mapping. FaultFS hooks every FS and File method; FailNth and Gate
cover ENOSPC on the n-th write and blocking ReadDir.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:26:28 +03:00
vrubelroman
5132daa292 feat(vfs): Walk, RemoveTree, DirSize, SameFile and Within helpers (2A.2)
One implementation for every FS. Walk and RemoveTree never follow symlinks,
so deleting a link to a directory removes only the link (N-P0-3). DirSize
returns the root error and counts unreadable subdirectories instead of
reporting a silent 0 B (N-P1-14). SameFile compares inodes locally and
RealPath on other volumes, so an alias directory is recognised (N-P0-6);
Within resolves symlinks on both sides and accepts a not-yet-existing child.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:24:12 +03:00
vrubelroman
c3de5a06ef feat(vfs/localfs): local vfs.FS with renameat2 NOREPLACE and lazy birth time (2A.1)
ReadDir has lstat semantics and resolves symlink targets (NavigableDir for
links to directories, Target=nil + LinkErr for broken links: U-P1-2 at the
data level). Birth time is only computed through BirthTimer. NoReplace falls
back to link+unlink, then to an Lstat check, when renameat2 is unsupported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:22:49 +03:00
vrubelroman
2db51e9385 feat(vfs): define the vfs.FS contract, sentinels, PathOps and ReadOnly wrapper (2.0)
Types and interfaces from design §2.1: FS, File, FileInfo, Caps, VolumeID,
RenameMode, CreateMode, PathOps (posix and native), Location.Same, the
optional Trasher/BirthTimer/Execer interfaces and ReadOnly(fs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:21:41 +03:00