Lines Matching refs:name

93 	Open(name string) (ReaderAtSeekerCloser, error)
96 Exists(name string) (bool, bool, error)
103 IsDir(name string) (bool, error)
107 IsSymlink(name string) (bool, error)
110 Lstat(name string) (os.FileInfo, error)
113 Stat(name string) (os.FileInfo, error)
116 ListDirsRecursive(name string, follow ShouldFollowSymlinks) (dirs []string, err error)
119 ReadDirNames(name string) ([]string, error)
122 Readlink(name string) (string, error)
166 func (fs *osFs) Open(name string) (ReaderAtSeekerCloser, error) {
167 return os.Open(fs.toAbs(name))
170 func (fs *osFs) Exists(name string) (bool, bool, error) {
171 stat, err := os.Stat(fs.toAbs(name))
181 func (fs *osFs) IsDir(name string) (bool, error) {
182 info, err := os.Stat(fs.toAbs(name))
189 func (fs *osFs) IsSymlink(name string) (bool, error) {
190 if info, err := os.Lstat(fs.toAbs(name)); err != nil {
216 func (fs *osFs) ListDirsRecursive(name string, follow ShouldFollowSymlinks) (dirs []string, err err…
217 return listDirsRecursive(fs, name, follow)
220 func (fs *osFs) ReadDirNames(name string) ([]string, error) {
221 dir, err := os.Open(fs.toAbs(name))
236 func (fs *osFs) Readlink(name string) (string, error) {
237 return os.Readlink(fs.toAbs(name))
247 func (m *mockFs) followSymlinks(name string) string {
248 dir, file := saneSplit(name)
252 name = filepath.Join(dir, file)
259 to, exists := m.symlinks[name]
264 name = to
266 name = filepath.Join(dir, to)
269 return name
272 func (m *mockFs) Open(name string) (ReaderAtSeekerCloser, error) {
273 name = filepath.Clean(name)
274 name = m.followSymlinks(name)
275 if f, ok := m.files[name]; ok {
287 Path: name,
292 func (m *mockFs) Exists(name string) (bool, bool, error) {
293 name = filepath.Clean(name)
294 name = m.followSymlinks(name)
295 if _, ok := m.files[name]; ok {
298 if _, ok := m.dirs[name]; ok {
304 func (m *mockFs) IsDir(name string) (bool, error) {
305 dir := filepath.Dir(name)
316 return false, os.NewSyscallError("stat "+name, syscall.ENOTDIR)
320 name = filepath.Clean(name)
321 name = m.followSymlinks(name)
323 if _, ok := m.dirs[name]; ok {
326 if _, ok := m.files[name]; ok {
332 func (m *mockFs) IsSymlink(name string) (bool, error) {
333 dir, file := saneSplit(name)
335 name = filepath.Join(dir, file)
337 if _, isSymlink := m.symlinks[name]; isSymlink {
340 if _, isDir := m.dirs[name]; isDir {
343 if _, isFile := m.files[name]; isFile {
392 name string member
397 func (ms *mockStat) Name() string { return ms.name }
404 func (m *mockFs) Lstat(name string) (os.FileInfo, error) {
405 dir, file := saneSplit(name)
407 name = filepath.Join(dir, file)
410 name: file,
413 if symlink, isSymlink := m.symlinks[name]; isSymlink {
416 } else if _, isDir := m.dirs[name]; isDir {
418 } else if _, isFile := m.files[name]; isFile {
420 ms.size = int64(len(m.files[name]))
428 func (m *mockFs) Stat(name string) (os.FileInfo, error) {
429 name = filepath.Clean(name)
430 origName := name
431 name = m.followSymlinks(name)
434 name: filepath.Base(origName),
435 size: int64(len(m.files[name])),
438 if _, isDir := m.dirs[name]; isDir {
440 } else if _, isFile := m.files[name]; isFile {
442 ms.size = int64(len(m.files[name]))
450 func (m *mockFs) ReadDirNames(name string) ([]string, error) {
451 name = filepath.Clean(name)
452 name = m.followSymlinks(name)
454 exists, isDir, err := m.Exists(name)
468 if dir == name && len(file) > 0 && file[0] != '.' {
475 func (m *mockFs) ListDirsRecursive(name string, follow ShouldFollowSymlinks) ([]string, error) {
476 return listDirsRecursive(m, name, follow)
479 func (m *mockFs) Readlink(name string) (string, error) {
480 dir, file := saneSplit(name)
483 origName := name
484 name = filepath.Join(dir, file)
486 if dest, isSymlink := m.symlinks[name]; isSymlink {
490 if exists, _, err := m.Exists(name); err != nil {
499 func listDirsRecursive(fs FileSystem, name string, follow ShouldFollowSymlinks) ([]string, error) {
500 name = filepath.Clean(name)
502 isDir, err := fs.IsDir(name)
511 dirs := []string{name}
513 subDirs, err := listDirsRecursiveRelative(fs, name, follow, 0)
519 dirs = append(dirs, filepath.Join(name, d))
525 func listDirsRecursiveRelative(fs FileSystem, name string, follow ShouldFollowSymlinks, depth int) …
530 contents, err := fs.ReadDirNames(name)
540 f = filepath.Join(name, f)
557 rel, err := filepath.Rel(name, d)