Blob
1 package ufs3 import (4 "os"5 "sync"7 p9p "github.com/docker/go-p9p"8 )10 type FileRef struct {11 sync.Mutex12 Path string13 Info p9p.Dir14 File *os.File15 Readdir *p9p.Readdir16 }18 func (f *FileRef) Stat() error {19 f.Lock()20 defer f.Unlock()21 return f.statLocked()22 }24 func (f *FileRef) statLocked() error {25 info, err := os.Lstat(f.Path)26 if err != nil {27 return err28 }30 f.Info = dirFromInfo(info)31 return nil32 }34 func (f *FileRef) IsDir() bool {35 return f.Info.Mode&p9p.DMDIR > 036 }