5 // Information specific to a single file inside the MetaInfo structure.
7 // BEP3. With BEP 47 this can be optional, but we have no way to describe that without breaking
9 Length int64 `bencode:"length"`
10 Path []string `bencode:"path"` // BEP3
11 PathUtf8 []string `bencode:"path.utf-8,omitempty"`
16 func (fi *FileInfo) DisplayPath(info *Info) string {
18 return strings.Join(fi.BestPath(), "/")
20 return info.BestName()
24 func (me FileInfo) Offset(info *Info) (ret int64) {
25 for _, fi := range info.UpvertedFiles() {
26 if me.DisplayPath(info) == fi.DisplayPath(info) {
34 func (fi FileInfo) BestPath() []string {
35 if len(fi.PathUtf8) != 0 {