Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 98 for sameFile (0.17 sec)

  1. src/os/getwd.go

    	getwdCache.Unlock()
    	if len(dir) > 0 {
    		d, err := statNolog(dir)
    		if err == nil && SameFile(dot, d) {
    			return dir, nil
    		}
    	}
    
    	// Root is a special case because it has no parent
    	// and ends in a slash.
    	root, err := statNolog("/")
    	if err != nil {
    		// Can't stat root - no hope.
    		return "", err
    	}
    	if SameFile(root, dot) {
    		return "/", nil
    	}
    
    	// General algorithm: find name in parent
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 28 06:28:02 UTC 2020
    - 2.5K bytes
    - Viewed (0)
  2. src/os/types.go

    // SameFile reports whether fi1 and fi2 describe the same file.
    // For example, on Unix this means that the device and inode fields
    // of the two underlying structures are identical; on other systems
    // the decision may be based on the path names.
    // SameFile only applies to results returned by this package's [Stat].
    // It returns false in other cases.
    func SameFile(fi1, fi2 FileInfo) bool {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 20:52:06 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  3. src/os/stat_test.go

    		t.Error(err)
    		return
    	}
    	params.statCheck(t, path, sfi2)
    
    	if !os.SameFile(sfi, sfi2) {
    		t.Errorf("stat of open %q file and stat of %q should be the same", path, path)
    	}
    
    	if params.isLink {
    		if os.SameFile(sfi2, lsfi) {
    			t.Errorf("stat of opened %q file and lstat of %q should not be the same", path, path)
    		}
    	} else {
    		if !os.SameFile(sfi2, lsfi) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 22:38:03 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  4. src/os/executable_test.go

    		t.Fatalf("Child returned %q, want an absolute path", out)
    	}
    	if !sameFile(outs, ep) {
    		t.Fatalf("Child returned %q, not the same file as %q", out, ep)
    	}
    }
    
    func sameFile(fn1, fn2 string) bool {
    	fi1, err := os.Stat(fn1)
    	if err != nil {
    		return false
    	}
    	fi2, err := os.Stat(fn2)
    	if err != nil {
    		return false
    	}
    	return os.SameFile(fi1, fi2)
    }
    
    func init() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 05 23:35:32 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  5. 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)
  6. src/os/dir_windows.go

    func (d *dirInfo) init(h syscall.Handle) {
    	d.h = h
    	d.class = windows.FileFullDirectoryRestartInfo
    	// The previous settings are enough to read the directory entries.
    	// The following code is only needed to support os.SameFile.
    
    	// It is safe to query d.vol once and reuse the value.
    	// Hard links are not allowed to reference files in other volumes.
    	// Junctions and symbolic links can reference files and directories in other volumes,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 20:52:06 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  7. 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)
  8. platforms/ide/ide-native/src/test/groovy/org/gradle/ide/visualstudio/internal/DefaultVisualStudioProjectTest.groovy

        }
    
        def "has consistent uuid for same file"() {
            when:
            def file = new File("foo")
            def sameFile = new File("foo")
            def differentFile = new File("bar")
    
            then:
            getUUID(file) == getUUID(sameFile)
            getUUID(file) != getUUID(differentFile)
        }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Sep 26 14:49:12 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  9. platforms/ide/ide/src/test/groovy/org/gradle/plugins/ide/eclipse/model/internal/FileReferenceFactoryTest.groovy

            TestFile file = rootDir.file("a/file.txt")
            def reference = factory.fromFile(file)
            def sameFile = factory.fromFile(file)
            def differentFile = factory.fromFile(rootDir)
    
            expect:
            reference Matchers.strictlyEqual(sameFile)
            reference != differentFile
        }
    
        private String relpath(File file) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Sep 26 14:49:12 UTC 2023
    - 4K bytes
    - Viewed (0)
  10. src/os/types_unix.go

    func (fs *fileStat) Mode() FileMode     { return fs.mode }
    func (fs *fileStat) ModTime() time.Time { return fs.modTime }
    func (fs *fileStat) Sys() any           { return &fs.sys }
    
    func sameFile(fs1, fs2 *fileStat) bool {
    	return fs1.sys.Dev == fs2.sys.Dev && fs1.sys.Ino == fs2.sys.Ino
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 776 bytes
    - Viewed (0)
Back to top