pathcase

package
v1.2.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package pathcase measures whether a filesystem folds the case of names: the one place in this codebase where a probe file is written and read back under another case. Two callers ask the same question the same way -- pkg/sandbox for its containment predicates and pkg/swarm for its slot containment -- so the probe lives here once instead of twice.

The answer a silent filesystem gives is the CALLER's choice and is passed in as `unanswerable`: pkg/sandbox leans `false` (a containment answer that a case fold walks around is then a secret refused rather than a sound HOME refused), while pkg/swarm leans `true` (there a refusal a person can read and edit is worth more than a key file copied inside the wall). The rule is named in each caller's comment at the call site.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaseBoundaryDir

func CaseBoundaryDir(t *testing.T) (dir string, folds bool, found bool)

CaseBoundaryDir finds a directory whose OWN NAME folds one way in its parent while lookups INSIDE it fold the other way -- a MOUNT BOUNDARY, the one place the two can differ (the case-sensitive-image setup this codebase already uses: `TMPDIR=<volume>/tmp` puts the volume root on that path). It looks along the ancestors of t.TempDir() up to one level above os.TempDir(), and the bound keeps every probe write inside temp directories and their volume root. Where no boundary is reachable it returns found=false.

func ProbeFolds

func ProbeFolds(dir string, unanswerable bool) bool

ProbeFolds puts the question to the filesystem by writing IN THE DIRECTORY ASKED ABOUT: one probe file whose name carries capitals, asked for again in another case, and removed either way. The write is the only way to ask a directory about its own lookups, and it happens while the policy is built, never inside the wall.

THE CLIMB IS THE ONE INFERENCE LEFT, and it is only for a directory that IS NOT THERE: a path nobody has created cannot be asked, so the nearest existing ancestor answers for it, and that ancestor can be on another filesystem. It does not climb past a directory that IS there and refused the write, because that would answer about a volume nobody asked about. `unanswerable` is what it answers where no write could be made at all -- the one case where the filesystem said nothing, and the caller decides which way it then leans.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL