Lines Matching refs:path

41 	for path, bytes := range files {
42 dir := filepath.Dir(path)
44 fs.WriteFile(path, bytes, 0777)
53 Lstat(path string) (stats os.FileInfo, err error)
54 Stat(path string) (stats os.FileInfo, err error)
55 ReadDir(path string) (contents []DirEntryInfo, err error)
63 WriteFile(path string, data []byte, perm os.FileMode) (err error)
64 Remove(path string) (err error)
65 RemoveAll(path string) (err error)
99 func (osFs) Lstat(path string) (stats os.FileInfo, err error) {
100 return os.Lstat(path)
103 func (osFs) Stat(path string) (stats os.FileInfo, err error) {
104 return os.Stat(path)
107 func (osFs) ReadDir(path string) (contents []DirEntryInfo, err error) {
108 entries, err := readdir(path)
123 func (osFs) WriteFile(path string, data []byte, perm os.FileMode) error {
124 return ioutil.WriteFile(path, data, perm)
127 func (osFs) Remove(path string) error {
128 return os.Remove(path)
131 func (osFs) RemoveAll(path string) error {
132 return os.RemoveAll(path)
168 func pathSplit(path string) (dir string, leaf string) {
169 dir, leaf = filepath.Split(path)
232 func (m *MockFs) resolve(path string, followLastLink bool) (result string, err error) {
233 if !filepath.IsAbs(path) {
234 path = filepath.Join(m.workDir, path)
236 path = filepath.Clean(path)
238 return m.followLinks(path, followLastLink, 10)
242 func (m *MockFs) followLinks(path string, followLastLink bool, count int) (canonicalPath string, er…
243 if path == "/" {
244 return path, nil
247 parentPath, leaf := pathSplit(path)
248 if parentPath == path {
249 err = fmt.Errorf("Internal error: %v yields itself as a parent", path)
265 Path: path,
276 Path: path,
284 Path: path,
292 return path, nil
349 func (m *MockFs) Open(path string) (io.ReadCloser, error) {
350 path, err := m.resolve(path, true)
359 parentPath, base := pathSplit(path)
380 path string member
390 return m.path
413 func (m *MockFs) dirToFileInfo(d *mockDir, path string) (info *mockFileInfo) {
415 path: filepath.Base(path),
426 func (m *MockFs) fileToFileInfo(f *mockFile, path string) (info *mockFileInfo) {
428 path: filepath.Base(path),
438 func (m *MockFs) linkToFileInfo(l *mockLink, path string) (info *mockFileInfo) {
440 path: filepath.Base(path),
450 func (m *MockFs) Lstat(path string) (stats os.FileInfo, err error) {
453 m.StatCalls = append(m.StatCalls, path)
457 path, err = m.resolve(path, false)
463 if path == "/" {
468 parentPath, baseName := pathSplit(path)
475 return m.dirToFileInfo(subdir, path), nil
479 return m.fileToFileInfo(file, path), nil
483 return m.linkToFileInfo(link, path), nil
488 Path: path,
493 func (m *MockFs) Stat(path string) (stats os.FileInfo, err error) {
495 path, err = m.resolve(path, true)
500 return m.Lstat(path)
526 func (m *MockFs) ReadDir(path string) (contents []DirEntryInfo, err error) {
529 m.ReadDirCalls = append(m.ReadDirCalls, path)
533 path, err = m.resolve(path, true)
538 dir, err := m.getDir(path, false)
545 Path: path,
758 func (m *MockFs) MkDirs(path string) error {
759 _, err := m.getDir(path, true)
764 func (m *MockFs) getDir(path string, createIfMissing bool) (dir *mockDir, err error) {
765 cleanedPath := filepath.Clean(path)
771 if len(parentPath) >= len(path) {
781 Path: path,
793 Path: path,
804 Path: path,
813 func (m *MockFs) Remove(path string) (err error) {
814 path, err = m.resolve(path, false)
815 parentPath, leaf := pathSplit(path)
817 return fmt.Errorf("Cannot remove %v\n", path)
826 Path: path,
833 Path: path,
841 Path: path,
853 Path: path,
885 func (m *MockFs) RemoveAll(path string) (err error) {
886 path, err = m.resolve(path, false)
890 parentPath, leaf := pathSplit(path)
892 return fmt.Errorf("Cannot remove %v\n", path)
901 Path: path,
908 Path: path,
916 return m.Remove(path)
923 Path: path,
934 func (m *MockFs) SetReadable(path string, readable bool) error {
939 return m.SetReadErr(path, readErr)
942 func (m *MockFs) SetReadErr(path string, readErr error) error {
943 path, err := m.resolve(path, false)
947 parentPath, leaf := filepath.Split(path)