Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for AppendFile (0.17 sec)

  1. cmd/storage-rest_test.go

    		}
    	}
    }
    
    func testStorageAPIRenameFile(t *testing.T, storage StorageAPI) {
    	err := storage.AppendFile(context.Background(), "foo", "myobject", []byte("foo"))
    	if err != nil {
    		t.Fatalf("unexpected error %v", err)
    	}
    
    	err = storage.AppendFile(context.Background(), "foo", "otherobject", []byte("foo"))
    	if err != nil {
    		t.Fatalf("unexpected error %v", err)
    	}
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Jan 30 20:43:25 GMT 2024
    - 11.4K bytes
    - Viewed (0)
  2. internal/ioutil/append-file_windows.go

    package ioutil
    
    import (
    	"io"
    	"os"
    
    	"github.com/minio/minio/internal/lock"
    )
    
    // AppendFile - appends the file "src" to the file "dst"
    func AppendFile(dst string, src string, osync bool) error {
    	appendFile, err := lock.Open(dst, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0o666)
    	if err != nil {
    		return err
    	}
    	defer appendFile.Close()
    
    	srcFile, err := lock.Open(src, os.O_RDONLY, 0o666)
    	if err != nil {
    		return err
    	}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 1.2K bytes
    - Viewed (0)
  3. internal/ioutil/append-file_nix.go

    package ioutil
    
    import (
    	"io"
    	"os"
    )
    
    // AppendFile - appends the file "src" to the file "dst"
    func AppendFile(dst string, src string, osync bool) error {
    	flags := os.O_WRONLY | os.O_APPEND | os.O_CREATE
    	if osync {
    		flags |= os.O_SYNC
    	}
    	appendFile, err := os.OpenFile(dst, flags, 0o666)
    	if err != nil {
    		return err
    	}
    	defer appendFile.Close()
    
    	srcFile, err := os.Open(src)
    	if err != nil {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 1.3K bytes
    - Viewed (0)
  4. cmd/xl-storage_windows_test.go

    	if err != nil {
    		t.Fatal(err)
    	}
    
    	err = fs.AppendFile(context.Background(), "voldir", "/file", []byte("hello"))
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	// Try to create a file that includes a file in its path components.
    	// In *nix, this returns syscall.ENOTDIR while in windows we receive the following error.
    	err = fs.AppendFile(context.Background(), "voldir", "/file/obj1", []byte("hello"))
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Wed Nov 29 06:35:16 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  5. cmd/xl-storage_test.go

    	// Create test files for further reading.
    	for i, appendFile := range appendFiles {
    		err = xlStorage.AppendFile(context.Background(), volume, appendFile.fileName, []byte("hello, world"))
    		if err != appendFile.expectedErr {
    			t.Fatalf("Creating file failed: %d %#v, expected: %s, got: %s", i+1, appendFile, appendFile.expectedErr, err)
    		}
    	}
    
    	{
    		buf := make([]byte, 5)
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 11 17:45:28 GMT 2024
    - 66.7K bytes
    - Viewed (0)
  6. internal/ioutil/ioutil_test.go

    	defer os.Remove(name2)
    	f.WriteString("bbbbbbbbbb")
    	f.Close()
    
    	if err = AppendFile(name1, name2, false); err != nil {
    		t.Error(err)
    	}
    
    	b, err := os.ReadFile(name1)
    	if err != nil {
    		t.Error(err)
    	}
    
    	expected := "aaaaaaaaaabbbbbbbbbb"
    	if string(b) != expected {
    		t.Errorf("AppendFile() failed, expected: %s, got %s", expected, string(b))
    	}
    }
    
    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)
  7. cmd/xl-storage_unix_test.go

    		t.Fatalf("Creating a volume failed with %s expected to pass.", err)
    	}
    
    	// Attempt to create a file to verify the permissions later.
    	// AppendFile creates file with 0666 perms.
    	if err = disk.AppendFile(context.Background(), testCase.volName, pathJoin("hello-world.txt", xlStorageFormatFile), []byte("Hello World")); err != nil {
    		t.Fatalf("Create a file `test` failed with %s expected to pass.", err)
    	}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Jul 25 19:37:26 GMT 2022
    - 3.4K bytes
    - Viewed (0)
  8. cmd/storage-rest-common.go

    	storageRESTVersionPrefix = SlashSeparator + storageRESTVersion
    	storageRESTPrefix        = minioReservedBucketPath + "/storage"
    )
    
    const (
    	storageRESTMethodHealth = "/health"
    
    	storageRESTMethodAppendFile     = "/appendfile"
    	storageRESTMethodCreateFile     = "/createfile"
    	storageRESTMethodWriteAll       = "/writeall"
    	storageRESTMethodReadVersion    = "/readversion"
    	storageRESTMethodReadXL         = "/readxl"
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Feb 12 21:00:20 GMT 2024
    - 2.9K bytes
    - Viewed (0)
  9. cmd/bitrot-whole.go

    	volume    string
    	filePath  string
    	shardSize int64 // This is the shard size of the erasure logic
    	hash.Hash       // For bitrot hash
    }
    
    func (b *wholeBitrotWriter) Write(p []byte) (int, error) {
    	err := b.disk.AppendFile(context.TODO(), b.volume, b.filePath, p)
    	if err != nil {
    		return 0, err
    	}
    	_, err = b.Hash.Write(p)
    	if err != nil {
    		return 0, err
    	}
    	return len(p), nil
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Wed Jan 31 02:11:45 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  10. cmd/naughty-disk_test.go

    		return err
    	}
    	return d.disk.CreateFile(ctx, origvolume, volume, path, size, reader)
    }
    
    func (d *naughtyDisk) AppendFile(ctx context.Context, volume string, path string, buf []byte) error {
    	if err := d.calcError(); err != nil {
    		return err
    	}
    	return d.disk.AppendFile(ctx, volume, path, buf)
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Apr 15 08:25:46 GMT 2024
    - 9.3K bytes
    - Viewed (0)
Back to top