Documentation
¶
Overview ¶
Package filename fits the file names a run derives from qualified names into what every common filesystem takes, and keeps a set of them apart: a name too long for one path component is cut and tagged with a hash of the whole, names that meet letter case aside are tagged until no two meet, and a stem a filesystem reads as a device is told so its caller can encode it.
Index ¶
Constants ¶
const ( Max = 255 TagBytes = 8 )
Max is the longest name every common filesystem takes for one path component; TagBytes of the encoded name's hash keep a cut name apart from its neighbours.
Variables ¶
This section is empty.
Functions ¶
func CaseFolded ¶
CaseFolded is text under simple Unicode case folding, the key two files of a Plan meet under: two texts fold alike exactly when strings.EqualFold holds of them.
func DeviceStem ¶
DeviceStem reports whether the stem of name, what precedes its first `.`, is one Windows reads as a device whatever the extension, trailing spaces and letter case aside.
func Fit ¶
Fit is name+ext, cut to Max bytes and tagged with `~` and a hash of the whole name when tagged or when it is too long. The cut splits neither a UTF-8 sequence nor a trailing three-byte escape, `escape` being the byte the name's encoding opens one with (`%` in `%2F`).
Types ¶
type CollisionError ¶
CollisionError reports two names whose files meet even when tagged, which only names that are the same, or differ in bytes the encoding drops, can.
func (*CollisionError) Error ¶
func (e *CollisionError) Error() string