Stat returns info about the file
(filePath string)
| 212 | |
| 213 | // Stat returns info about the file |
| 214 | func (dirs Fs) Stat(filePath string) (fi os.FileInfo, err error) { |
| 215 | defer log.Trace(nil, "filePath=%q", filePath)("fi=%+v, err=%v", &fi, &err) |
| 216 | filePath = filepath.ToSlash(filePath) |
| 217 | filePath = enc.ToStandardPath(filePath) |
| 218 | filePath = strings.TrimLeft(filePath, "/") |
| 219 | if filePath == "" { |
| 220 | return &FileInfo{fs.NewDir("", time.Now())}, nil |
| 221 | } |
| 222 | _, entry := dirtree.DirTree(dirs).Find(filePath) |
| 223 | if entry == nil { |
| 224 | return nil, fmt.Errorf("couldn't find %q in directory cache", filePath) |
| 225 | } |
| 226 | return &FileInfo{entry}, nil |
| 227 | } |
| 228 | |
| 229 | // ReadDir returns info about the directory and fills up the directory cache |
| 230 | func (dirs Fs) ReadDir(dir string) (names []string, err error) { |