Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 425 for readAt (0.18 sec)

  1. src/os/file.go

    	return e.Err
    }
    
    // Read reads up to len(b) bytes from the File and stores them in b.
    // It returns the number of bytes read and any error encountered.
    // At end of file, Read returns 0, io.EOF.
    func (f *File) Read(b []byte) (n int, err error) {
    	if err := f.checkValid("read"); err != nil {
    		return 0, err
    	}
    	n, e := f.read(b)
    	return n, f.wrapErr("read", e)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 23:07:37 UTC 2024
    - 25.4K bytes
    - Viewed (0)
  2. src/cmd/link/internal/loadpe/ldpe.go

    )
    
    // TODO(brainman): maybe just add ReadAt method to bio.Reader instead of creating peBiobuf
    
    // peBiobuf makes bio.Reader look like io.ReaderAt.
    type peBiobuf bio.Reader
    
    func (f *peBiobuf) ReadAt(p []byte, off int64) (int, error) {
    	ret := ((*bio.Reader)(f)).MustSeek(off, 0)
    	if ret < 0 {
    		return 0, errors.New("fail to seek")
    	}
    	n, err := f.Read(p)
    	if err != nil {
    		return 0, err
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 20:26:46 UTC 2023
    - 26.5K bytes
    - Viewed (0)
  3. src/cmd/internal/objfile/disasm.go

    		} else {
    			text = x86asm.GoSyntax(inst, pc, lookup)
    		}
    	}
    	return text, size
    }
    
    type textReader struct {
    	code []byte
    	pc   uint64
    }
    
    func (r textReader) ReadAt(data []byte, off int64) (n int, err error) {
    	if off < 0 || uint64(off) < r.pc {
    		return 0, io.EOF
    	}
    	d := uint64(off) - r.pc
    	if d >= uint64(len(r.code)) {
    		return 0, io.EOF
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 20 02:13:02 UTC 2022
    - 10.5K bytes
    - Viewed (0)
  4. cmd/sftp-server-driver.go

    }
    
    func (f *sftpDriver) Fileread(r *sftp.Request) (ra io.ReaderAt, err error) {
    	// This is not timing the actual read operation, but the time it takes to prepare the reader.
    	stopFn := globalSftpMetrics.log(r, f.AccessKey())
    	defer stopFn(0, err)
    
    	flags := r.Pflags()
    	if !flags.Read {
    		// sanity check
    		return nil, os.ErrInvalid
    	}
    
    	bucket, object := path2BucketObject(r.Filepath)
    	if bucket == "" {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed Jun 05 07:51:13 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  5. src/debug/buildinfo/buildinfo.go

    		} else {
    			bo = binary.LittleEndian
    		}
    		var readPtr func([]byte) uint64
    		if ptrSize == 4 {
    			readPtr = func(b []byte) uint64 { return uint64(bo.Uint32(b)) }
    		} else if ptrSize == 8 {
    			readPtr = bo.Uint64
    		} else {
    			return "", "", errNotGoExe
    		}
    		vers = readString(x, ptrSize, readPtr, readPtr(data[16:]))
    		mod = readString(x, ptrSize, readPtr, readPtr(data[16+ptrSize:]))
    	}
    	if vers == "" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 12.6K bytes
    - Viewed (0)
  6. src/embed/embed.go

    	files  []file // the directory contents
    	offset int    // the read offset, an index into the files slice
    }
    
    func (d *openDir) Close() error               { return nil }
    func (d *openDir) Stat() (fs.FileInfo, error) { return d.f, nil }
    
    func (d *openDir) Read([]byte) (int, error) {
    	return 0, &fs.PathError{Op: "read", Path: d.f.name, Err: errors.New("is a directory")}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 19:42:51 UTC 2024
    - 13.5K bytes
    - Viewed (0)
  7. src/testing/fstest/testfs.go

    	if err != nil {
    		t.errorf("%s: fs.ReadFile: %w", file, err)
    		return
    	}
    	t.checkFileRead(file, "ReadAll vs fs.ReadFile", data, data2)
    
    	// Use iotest.TestReader to check small reads, Seek, ReadAt.
    	f, err = t.fsys.Open(file)
    	if err != nil {
    		t.errorf("%s: second Open: %w", file, err)
    		return
    	}
    	defer f.Close()
    	if err := iotest.TestReader(f, data); err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 16.3K bytes
    - Viewed (0)
  8. src/cmd/go/internal/modfetch/cache.go

    	if err != nil {
    		return "", err
    	}
    	return sum, nil
    }
    
    var errNotCached = fmt.Errorf("not in cache")
    
    // readDiskStat reads a cached stat result from disk,
    // returning the name of the cache file and the result.
    // If the read fails, the caller can use
    // writeDiskStat(file, info) to write a new cache entry.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 18:15:22 UTC 2024
    - 24.7K bytes
    - Viewed (0)
  9. src/runtime/race/testdata/mop_test.go

    	// Create several goroutines that end after calling runtime.RaceDisable.
    	var wg sync.WaitGroup
    	ready := make(chan struct{})
    	wg.Add(32)
    	for i := 0; i < 32; i++ {
    		go func() {
    			<-ready // ensure we have multiple goroutines running at the same time
    			runtime.RaceDisable()
    			wg.Done()
    		}()
    	}
    	close(ready)
    	wg.Wait()
    
    	// Make sure race detector still works. If the runtime.RaceDisable state
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 23 16:46:25 UTC 2023
    - 28.9K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tensorflow/tests/tpu-merge-variables-with-execute.mlir

      // CHECK-NEXT: "tf.TPUExecuteAndUpdateVariables"(%[[READ_0]], %[[ARG_1]], %[[ARG_4]], %[[READ_5]], %[[COMPILE]]#1)
      // CHECK-SAME: device_var_reads_indices = [1, 2],
      // CHECK-SAME: device_var_updates_indices = [1, -1]
      %execute:3 = "tf_device.launch"() ({
        %0:3 = "tf.TPUExecute"(%read0, %read1, %read2, %read5, %compile#1) {
          Targs = [tensor<32xf32>, tensor<64xf32>, tensor<8xf32>, tensor<2xf32>],
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Oct 31 08:59:10 UTC 2023
    - 24.5K bytes
    - Viewed (0)
Back to top