Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 43 for sameFile (0.34 sec)

  1. src/os/os_windows_test.go

    		t.Errorf("SameFile(%v, %v) = true; want false", f1, f2)
    	}
    
    	// Check that os.SameFile works with a mix of os.ReadDir and os.Stat files.
    	f1s, err := os.Stat(pathA)
    	if err != nil {
    		t.Fatal(err)
    	}
    	f2s, err := os.Stat(pathB)
    	if err != nil {
    		t.Fatal(err)
    	}
    	if !os.SameFile(f1, f1s) {
    		t.Errorf("SameFile(%v, %v) = false; want true", f1, f1s)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 41.8K bytes
    - Viewed (0)
  2. src/os/types_windows.go

    		idxhi:          d.FileIndexHigh,
    		idxlo:          d.FileIndexLow,
    		ReparseTag:     reparseTag,
    		// fileStat.path is used by os.SameFile to decide if it needs
    		// to fetch vol, idxhi and idxlo. But these are already set,
    		// so set fileStat.path to "" to prevent os.SameFile doing it again.
    	}, nil
    }
    
    // newFileStatFromWin32FileAttributeData copies all required information
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 18:44:48 UTC 2024
    - 11.7K bytes
    - Viewed (0)
  3. internal/ioutil/ioutil.go

    	bufp := copyBufPool.Get().(*[]byte)
    	buf := *bufp
    	defer copyBufPool.Put(bufp)
    
    	return io.CopyBuffer(dst, src, buf)
    }
    
    // SameFile returns if the files are same.
    func SameFile(fi1, fi2 os.FileInfo) bool {
    	if !os.SameFile(fi1, fi2) {
    		return false
    	}
    	if !fi1.ModTime().Equal(fi2.ModTime()) {
    		return false
    	}
    	if fi1.Mode() != fi2.Mode() {
    		return false
    	}
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed May 22 23:07:14 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  4. src/cmd/dist/util.go

    func errprintf(format string, args ...interface{}) {
    	fmt.Fprintf(os.Stderr, format, args...)
    }
    
    // xsamefile reports whether f1 and f2 are the same file (or dir).
    func xsamefile(f1, f2 string) bool {
    	fi1, err1 := os.Stat(f1)
    	fi2, err2 := os.Stat(f2)
    	if err1 != nil || err2 != nil {
    		return f1 == f2
    	}
    	return os.SameFile(fi1, fi2)
    }
    
    func xgetgoarm() string {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 23 17:50:29 UTC 2023
    - 11.2K bytes
    - Viewed (0)
  5. src/net/http/cgi/host_test.go

    		}
    		m[k] = v
    	}
    
    	for key, expected := range expectedMap {
    		got := m[key]
    		if key == "cwd" {
    			// For Windows. golang.org/issue/4645.
    			fi1, _ := os.Stat(got)
    			fi2, _ := os.Stat(expected)
    			if os.SameFile(fi1, fi2) {
    				got = expected
    			}
    		}
    		if got != expected {
    			t.Errorf("for key %q got %q; expected %q", key, got, expected)
    		}
    	}
    	for _, check := range checks {
    		check(m)
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 18:29:59 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  6. src/os/file_unix.go

    		if ofi, err := Lstat(oldname); err != nil {
    			if pe, ok := err.(*PathError); ok {
    				err = pe.Err
    			}
    			return &LinkError{"rename", oldname, newname, err}
    		} else if newname == oldname || !SameFile(fi, ofi) {
    			return &LinkError{"rename", oldname, newname, syscall.EEXIST}
    		}
    	}
    	err = ignoringEINTR(func() error {
    		return syscall.Rename(oldname, newname)
    	})
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 13:52:34 UTC 2024
    - 14.9K bytes
    - Viewed (0)
  7. src/cmd/go/internal/cfg/cfg.go

    func isSameDir(dir1, dir2 string) bool {
    	if dir1 == dir2 {
    		return true
    	}
    	info1, err1 := os.Stat(dir1)
    	info2, err2 := os.Stat(dir2)
    	return err1 == nil && err2 == nil && os.SameFile(info1, info2)
    }
    
    // isGOROOT reports whether path looks like a GOROOT.
    //
    // It does this by looking for the path/pkg/tool directory,
    // which is necessary for useful operation of the cmd/go tool,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 17:13:51 UTC 2024
    - 19.3K bytes
    - Viewed (0)
  8. pkg/volume/util/subpath/subpath_linux.go

    	}
    
    	t, err := os.Lstat(bindMountTarget)
    	if err != nil {
    		return false, fmt.Errorf("lstat %s failed: %s", bindMountTarget, err)
    	}
    
    	if !os.SameFile(s, t) {
    		return false, nil
    	}
    	return true, nil
    }
    
    func getSubpathBindTarget(subpath Subpath) string {
    	// containerName is DNS label, i.e. safe as a directory name.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jul 12 14:09:11 UTC 2022
    - 21.4K bytes
    - Viewed (0)
  9. src/path/filepath/path_test.go

    			continue
    		}
    
    		abspath, err := filepath.Abs(path)
    		if err != nil {
    			t.Errorf("Abs(%q) error: %v", path, err)
    			continue
    		}
    		absinfo, err := os.Stat(abspath)
    		if err != nil || !os.SameFile(absinfo, info) {
    			t.Errorf("Abs(%q)=%q, not the same file", path, abspath)
    		}
    		if !filepath.IsAbs(abspath) {
    			t.Errorf("Abs(%q)=%q, not an absolute path", path, abspath)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 22 16:38:19 UTC 2024
    - 47.1K bytes
    - Viewed (0)
  10. pkg/volume/util/subpath/subpath_linux_test.go

    			},
    			expectError:  false,
    			expectAction: []mount.FakeAction{{Action: "unmount"}},
    			mountExists:  false,
    		},
    		{
    			name: "subpath-mount-already-exists-with-samefile",
    			prepare: func(base string) ([]string, string, string, error) {
    				volpath, subpathMount := getTestPaths(base)
    				mounts := []string{subpathMount}
    				subpathMountRoot := filepath.Dir(subpathMount)
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Nov 10 16:52:55 UTC 2021
    - 37.3K bytes
    - Viewed (0)
Back to top