Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for saveFile (0.18 sec)

  1. internal/ioutil/ioutil_test.go

    	if err != nil {
    		t.Fatalf("Error Stat(): %v", err)
    	}
    	if !SameFile(fi1, fi2) {
    		t.Fatal("Expected the files to be same")
    	}
    	if err = os.WriteFile(tmpFile, []byte("aaa"), 0o644); err != nil {
    		t.Fatal(err)
    	}
    	fi2, err = os.Stat(tmpFile)
    	if err != nil {
    		t.Fatalf("Error Stat(): %v", err)
    	}
    	if SameFile(fi1, fi2) {
    		t.Fatal("Expected the files not to be same")
    	}
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Feb 02 11:02:31 GMT 2024
    - 5.1K bytes
    - Viewed (0)
  2. 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
    	}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 19 11:26:59 GMT 2024
    - 10.3K bytes
    - Viewed (0)
  3. cmd/xl-storage.go

    		s.RUnlock()
    		return diskID, nil
    	}
    	s.RUnlock()
    
    	fi, err := s.checkFormatJSON()
    	if err != nil {
    		return "", err
    	}
    
    	if xioutil.SameFile(fi, fileInfo) && diskID != "" {
    		s.Lock()
    		// If the file has not changed, just return the cached diskID information.
    		s.formatLastCheck = time.Now()
    		s.Unlock()
    		return diskID, nil
    	}
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 84.7K bytes
    - Viewed (0)
Back to top