package vfs // Location is "where a panel stands / where an operation writes". type Location struct { FS FS Path string } // Same reports whether both locations name the same path on the same volume // (lexically: equal VolumeID and equal cleaned paths). It does not resolve // symlinks; use SameFile or Within for identity. func (l Location) Same(o Location) bool { if l.FS == nil || o.FS == nil { return l.FS == nil && o.FS == nil && l.Path == o.Path } if l.FS.Volume() != o.FS.Volume() { return false } return l.FS.Paths().Clean(l.Path) == o.FS.Paths().Clean(o.Path) } // String renders "label:path" for logs and messages. func (l Location) String() string { if l.FS == nil { return l.Path } return l.FS.Label() + ":" + l.Path }