Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for LockedOpenFile (0.27 sec)

  1. internal/lock/lock_test.go

    		err = os.Remove(f.Name())
    		if err != nil {
    			t.Fatal(err)
    		}
    	}()
    
    	_, err = LockedOpenFile(f.Name(), os.O_APPEND, 0o600)
    	if err == nil {
    		t.Fatal("Should fail here")
    	}
    }
    
    // Tests lock directory fail.
    func TestLockDirFail(t *testing.T) {
    	d := t.TempDir()
    
    	_, err := LockedOpenFile(d, os.O_APPEND, 0o600)
    	if err == nil {
    		t.Fatal("Should fail here")
    	}
    }
    
    // Tests rwlock methods.
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 3.6K bytes
    - Viewed (0)
  2. internal/lock/lock_windows.go

    		//lint:ignore SA4016 Reasons
    		lockType = lockFileFailImmediately // Set this to enable shared lock and fail immediately.
    	}
    	return lockedOpenFile(path, flag, perm, lockType)
    }
    
    // LockedOpenFile - initializes a new lock and protects
    // the file from concurrent access.
    func LockedOpenFile(path string, flag int, perm os.FileMode) (*LockedFile, error) {
    	var lockType uint32 = lockFileExclusiveLock
    	if flag == syscall.O_RDONLY {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed Oct 18 18:08:15 GMT 2023
    - 7.9K bytes
    - Viewed (0)
Back to top