Blob


1 package ufs
3 import (
4 "os"
5 "sync"
7 p9p "github.com/docker/go-p9p"
8 )
10 type FileRef struct {
11 sync.Mutex
12 Path string
13 Info p9p.Dir
14 File *os.File
15 Readdir *p9p.Readdir
16 }
18 func (f *FileRef) Stat() error {
19 f.Lock()
20 defer f.Unlock()
22 info, err := os.Lstat(f.Path)
23 if err != nil {
24 return err
25 }
27 f.Info = dirFromInfo(info)
28 return nil
29 }
31 func (f *FileRef) IsDir() bool {
32 return f.Info.Mode&p9p.DMDIR > 0
33 }