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>
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>
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>
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>
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>