1 64abb42a 2018-04-10 noreply package ufs
7 c55b00ed 2021-12-31 op p9p "git.omarpolo.com/go-p9p"
10 64abb42a 2018-04-10 noreply type FileRef struct {
11 64abb42a 2018-04-10 noreply sync.Mutex
12 64abb42a 2018-04-10 noreply Path string
13 64abb42a 2018-04-10 noreply Info p9p.Dir
14 64abb42a 2018-04-10 noreply File *os.File
15 64abb42a 2018-04-10 noreply Readdir *p9p.Readdir
18 64abb42a 2018-04-10 noreply func (f *FileRef) Stat() error {
20 64abb42a 2018-04-10 noreply defer f.Unlock()
21 64abb42a 2018-04-10 noreply return f.statLocked()
24 64abb42a 2018-04-10 noreply func (f *FileRef) statLocked() error {
25 64abb42a 2018-04-10 noreply info, err := os.Lstat(f.Path)
26 64abb42a 2018-04-10 noreply if err != nil {
27 64abb42a 2018-04-10 noreply return err
30 64abb42a 2018-04-10 noreply f.Info = dirFromInfo(info)
31 64abb42a 2018-04-10 noreply return nil
34 64abb42a 2018-04-10 noreply func (f *FileRef) IsDir() bool {
35 64abb42a 2018-04-10 noreply return f.Info.Mode&p9p.DMDIR > 0