Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 27 for ReadFile (0.23 sec)

  1. cmd/sftp-server.go

    	if sshPrivateKey == "" {
    		logger.Fatal(fmt.Errorf("invalid arguments passed, private key file is mandatory for --sftp='ssh-private-key=path/to/id_ecdsa'"), "unable to start SFTP server")
    	}
    
    	privateBytes, err := os.ReadFile(sshPrivateKey)
    	if err != nil {
    		logger.Fatal(fmt.Errorf("invalid arguments passed, private key file is not accessible: %v", err), "unable to start SFTP server")
    	}
    
    	private, err := ssh.ParsePrivateKey(privateBytes)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed May 01 11:07:40 GMT 2024
    - 10.4K bytes
    - Viewed (0)
  2. cmd/format-erasure_test.go

    	if err != nil {
    		t.Fatal(err)
    	}
    
    	if migratedVersion != formatErasureVersionV3 {
    		t.Fatalf("expected version: %s, got: %s", formatErasureVersionV3, migratedVersion)
    	}
    
    	b, err = os.ReadFile(pathJoin(rootPath, minioMetaBucket, formatConfigFile))
    	if err != nil {
    		t.Fatal(err)
    	}
    	formatV3 := &formatErasureV3{}
    	if err = json.Unmarshal(b, formatV3); err != nil {
    		t.Fatal(err)
    	}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Apr 15 08:25:46 GMT 2024
    - 12.9K bytes
    - Viewed (0)
  3. internal/ioutil/read_file.go

    	_, err = io.ReadFull(f, dst)
    	return dst, st, err
    }
    
    // ReadFile reads the named file and returns the contents.
    // A successful call returns err == nil, not err == EOF.
    // Because ReadFile reads the whole file, it does not treat an EOF from Read
    // as an error to be reported.
    //
    // passes NOATIME flag for reads on Unix systems to avoid atime updates.
    func ReadFile(name string) ([]byte, error) {
    	// Don't wrap with un-needed buffer.
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sat Dec 09 18:17:51 GMT 2023
    - 2.3K bytes
    - Viewed (0)
  4. cmd/erasure-decode_test.go

    package cmd
    
    import (
    	"bytes"
    	"context"
    	crand "crypto/rand"
    	"io"
    	"math/rand"
    	"testing"
    
    	"github.com/dustin/go-humanize"
    )
    
    func (a badDisk) ReadFile(ctx context.Context, volume string, path string, offset int64, buf []byte, verifier *BitrotVerifier) (n int64, err error) {
    	return 0, errFaultyDisk
    }
    
    var erasureDecodeTests = []struct {
    	dataBlocks                   int
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Jan 30 20:43:25 GMT 2024
    - 21.1K bytes
    - Viewed (1)
  5. cmd/storage-rest-common.go

    	storageRESTMethodWriteAll       = "/writeall"
    	storageRESTMethodReadVersion    = "/readversion"
    	storageRESTMethodReadXL         = "/readxl"
    	storageRESTMethodReadAll        = "/readall"
    	storageRESTMethodReadFile       = "/readfile"
    	storageRESTMethodReadFileStream = "/readfilestream"
    	storageRESTMethodListDir        = "/listdir"
    	storageRESTMethodDeleteVersions = "/deleteverions"
    	storageRESTMethodRenameFile     = "/renamefile"
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Feb 12 21:00:20 GMT 2024
    - 2.9K bytes
    - Viewed (0)
  6. cmd/storage-rest-server.go

    		}
    		verifier = NewBitrotVerifier(BitrotAlgorithmFromString(r.Form.Get(storageRESTBitrotAlgo)), hash)
    	}
    	buf := make([]byte, length)
    	defer metaDataPoolPut(buf) // Reuse if we can.
    	_, err = s.getStorage().ReadFile(r.Context(), volume, filePath, int64(offset), buf, verifier)
    	if err != nil {
    		s.writeErrorResponse(w, err)
    		return
    	}
    	w.Header().Set(xhttp.ContentLength, strconv.Itoa(len(buf)))
    	w.Write(buf)
    }
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 44.8K bytes
    - Viewed (0)
  7. cmd/xl-storage-format-v2_test.go

    		if dataDir != tc.expectedDataDir {
    			t.Fatalf("Expected %s but got %s", tc.expectedDataDir, dataDir)
    		}
    		count++
    	}
    }
    
    func Benchmark_mergeXLV2Versions(b *testing.B) {
    	data, err := os.ReadFile("testdata/xl.meta-v1.2.zst")
    	if err != nil {
    		b.Fatal(err)
    	}
    	dec, _ := zstd.NewReader(nil)
    	data, err = dec.DecodeAll(data, nil)
    	if err != nil {
    		b.Fatal(err)
    	}
    
    	var xl xlMetaV2
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Mar 08 17:50:48 GMT 2024
    - 36.4K bytes
    - Viewed (0)
  8. cmd/metacache-walk.go

    				meta.name = decodeDirObject(meta.name)
    
    				return send(meta)
    			}
    			// Check legacy.
    			if HasSuffix(entry, xlStorageFormatFileV1) && legacy {
    				var meta metaCacheEntry
    				meta.metadata, err = xioutil.ReadFile(pathJoinBuf(sb, volumeDir, current, entry))
    				diskHealthCheckOK(ctx, err)
    				if err != nil {
    					if !IsErrIgnored(err, io.EOF, io.ErrUnexpectedEOF) {
    						internalLogIf(ctx, err)
    					}
    					continue
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Apr 15 08:25:46 GMT 2024
    - 12.4K bytes
    - Viewed (0)
  9. cmd/storage-interface.go

    	// File operations.
    	ListDir(ctx context.Context, origvolume, volume, dirPath string, count int) ([]string, error)
    	ReadFile(ctx context.Context, volume string, path string, offset int64, buf []byte, verifier *BitrotVerifier) (n int64, err error)
    	AppendFile(ctx context.Context, volume string, path string, buf []byte) (err error)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Apr 23 17:15:52 GMT 2024
    - 4.9K bytes
    - Viewed (0)
  10. internal/store/queuestore.go

    	store.RLock()
    
    	defer func(store *QueueStore[I]) {
    		store.RUnlock()
    		if err != nil {
    			// Upon error we remove the entry.
    			store.Del(key)
    		}
    	}(store)
    
    	raw, err = os.ReadFile(filepath.Join(store.directory, key+store.fileExt))
    	if err != nil {
    		return
    	}
    
    	if len(raw) == 0 {
    		return raw, os.ErrNotExist
    	}
    
    	return
    }
    
    // Get - gets an item from the store.
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Mar 25 16:44:20 GMT 2024
    - 7.1K bytes
    - Viewed (0)
Back to top