Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 172 for O_WRONLY (0.12 sec)

  1. src/runtime/syscall_unix_test.go

    	// TODO(mknyszek): Check other flags.
    	check := func(name string, got, want int) {
    		if got != want {
    			t.Errorf("flag %s does not line up: got %d, want %d", name, got, want)
    		}
    	}
    	check("O_WRONLY", runtime.O_WRONLY, syscall.O_WRONLY)
    	check("O_CREAT", runtime.O_CREAT, syscall.O_CREAT)
    	check("O_TRUNC", runtime.O_TRUNC, syscall.O_TRUNC)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 18 03:45:30 UTC 2022
    - 635 bytes
    - Viewed (0)
  2. src/cmd/go/internal/lockedfile/lockedfile_filelock.go

    	// consistently.
    
    	f, err := os.OpenFile(name, flag&^os.O_TRUNC, perm)
    	if err != nil {
    		return nil, err
    	}
    
    	switch flag & (os.O_RDONLY | os.O_WRONLY | os.O_RDWR) {
    	case os.O_WRONLY, os.O_RDWR:
    		err = filelock.Lock(f)
    	default:
    		err = filelock.RLock(f)
    	}
    	if err != nil {
    		f.Close()
    		return nil, err
    	}
    
    	if flag&os.O_TRUNC == os.O_TRUNC {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 28 18:17:57 UTC 2021
    - 1.7K bytes
    - Viewed (0)
  3. src/runtime/defs_dragonfly.go

    #include <errno.h>
    #include <signal.h>
    */
    import "C"
    
    const (
    	EINTR     = C.EINTR
    	EFAULT    = C.EFAULT
    	EBUSY     = C.EBUSY
    	EAGAIN    = C.EAGAIN
    	ETIMEDOUT = C.ETIMEDOUT
    
    	O_WRONLY   = C.O_WRONLY
    	O_NONBLOCK = C.O_NONBLOCK
    	O_CREAT    = C.O_CREAT
    	O_TRUNC    = C.O_TRUNC
    	O_CLOEXEC  = C.O_CLOEXEC
    
    	PROT_NONE  = C.PROT_NONE
    	PROT_READ  = C.PROT_READ
    	PROT_WRITE = C.PROT_WRITE
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 12 21:17:22 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  4. internal/lock/lock_nix.go

    func lockedOpenFile(path string, flag int, perm os.FileMode, lockType int) (*LockedFile, error) {
    	switch flag {
    	case syscall.O_RDONLY:
    		lockType |= syscall.LOCK_SH
    	case syscall.O_WRONLY:
    		fallthrough
    	case syscall.O_RDWR:
    		fallthrough
    	case syscall.O_WRONLY | syscall.O_CREAT:
    		fallthrough
    	case syscall.O_RDWR | syscall.O_CREAT:
    		lockType |= syscall.LOCK_EX
    	default:
    		return nil, &os.PathError{
    			Op:   "open",
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Aug 19 01:35:22 UTC 2021
    - 2.8K bytes
    - Viewed (0)
  5. src/runtime/defs_netbsd.go

    #include <sys/time.h>
    #include <sys/ucontext.h>
    #include <sys/unistd.h>
    #include <errno.h>
    #include <signal.h>
    */
    import "C"
    
    const (
    	EINTR  = C.EINTR
    	EFAULT = C.EFAULT
    	EAGAIN = C.EAGAIN
    
    	O_WRONLY   = C.O_WRONLY
    	O_NONBLOCK = C.O_NONBLOCK
    	O_CREAT    = C.O_CREAT
    	O_TRUNC    = C.O_TRUNC
    	O_CLOEXEC  = C.O_CLOEXEC
    
    	PROT_NONE  = C.PROT_NONE
    	PROT_READ  = C.PROT_READ
    	PROT_WRITE = C.PROT_WRITE
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 12 21:17:22 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  6. internal/lock/lock_solaris.go

    	var lockType int16
    	switch flag {
    	case syscall.O_RDONLY:
    		lockType = syscall.F_RDLCK
    	case syscall.O_WRONLY:
    		fallthrough
    	case syscall.O_RDWR:
    		fallthrough
    	case syscall.O_WRONLY | syscall.O_CREAT:
    		fallthrough
    	case syscall.O_RDWR | syscall.O_CREAT:
    		lockType = syscall.F_WRLCK
    	default:
    		return nil, &os.PathError{
    			Op:   "open",
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sun Jan 02 17:15:06 UTC 2022
    - 2.8K bytes
    - Viewed (0)
  7. src/cmd/vendor/golang.org/x/sys/plan9/const_plan9.go

    package plan9
    
    // Plan 9 Constants
    
    // Open modes
    const (
    	O_RDONLY  = 0
    	O_WRONLY  = 1
    	O_RDWR    = 2
    	O_TRUNC   = 16
    	O_CLOEXEC = 32
    	O_EXCL    = 0x1000
    )
    
    // Rfork flags
    const (
    	RFNAMEG  = 1 << 0
    	RFENVG   = 1 << 1
    	RFFDG    = 1 << 2
    	RFNOTEG  = 1 << 3
    	RFPROC   = 1 << 4
    	RFMEM    = 1 << 5
    	RFNOWAIT = 1 << 6
    	RFCNAMEG = 1 << 10
    	RFCENVG  = 1 << 11
    	RFCFDG   = 1 << 12
    	RFREND   = 1 << 13
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 15 19:02:39 UTC 2021
    - 1004 bytes
    - Viewed (0)
  8. src/cmd/go/internal/modload/stat_openfile.go

    	"io/fs"
    	"os"
    )
    
    // hasWritePerm reports whether the current user has permission to write to the
    // file with the given info.
    func hasWritePerm(path string, _ fs.FileInfo) bool {
    	if f, err := os.OpenFile(path, os.O_WRONLY, 0); err == nil {
    		f.Close()
    		return true
    	}
    	return false
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 12 16:45:11 UTC 2022
    - 791 bytes
    - Viewed (0)
  9. tensorflow/c/experimental/filesystem/plugins/posix/posix_filesystem_helper.cc

      // When creating file, use the same permissions as original
      mode_t open_mode = mode & (S_IRWXU | S_IRWXG | S_IRWXO);
    
      // O_WRONLY | O_CREAT | O_TRUNC:
      //   Open file for write and if file does not exist, create the file.
      //   If file exists, truncate its size to 0.
      int dst_fd = open(dst, O_WRONLY | O_CREAT | O_TRUNC, open_mode);
      if (dst_fd < 0) {
        close(src_fd);
        return -1;
      }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Jan 16 05:36:52 UTC 2020
    - 2.1K bytes
    - Viewed (0)
  10. internal/lock/lock_test.go

    			t.Fatal(err)
    		}
    	}()
    
    	// lock the file
    	l, err := LockedOpenFile(f.Name(), os.O_WRONLY, 0o600)
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	// unlock the file
    	if err = l.Close(); err != nil {
    		t.Fatal(err)
    	}
    
    	// try lock the unlocked file
    	dupl, err := LockedOpenFile(f.Name(), os.O_WRONLY|os.O_CREATE, 0o600)
    	if err != nil {
    		t.Errorf("err = %v, want %v", err, nil)
    	}
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Sep 19 18:05:16 UTC 2022
    - 3.6K bytes
    - Viewed (0)
Back to top