Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for O_RDONLY (0.17 sec)

  1. src/syscall/dirent_test.go

    		err := os.WriteFile(filepath.Join(d, name), nil, 0644)
    		if err != nil {
    			t.Fatalf("writefile: %v", err)
    		}
    	}
    
    	names := make([]string, 0, 10)
    
    	fd, err := syscall.Open(d, syscall.O_RDONLY, 0)
    	if err != nil {
    		t.Fatalf("syscall.open: %v", err)
    	}
    	defer syscall.Close(fd)
    
    	buf := bytes.Repeat([]byte{0xCD}, direntBufSize)
    	for {
    		n, err := syscall.ReadDirent(fd, buf)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 3.4K bytes
    - Viewed (0)
  2. src/syscall/getdirentries_test.go

    		if err != nil {
    			t.Fatalf("WriteFile: %v", err)
    		}
    	}
    
    	// Read files using Getdirentries
    	var names2 []string
    	fd, err := syscall.Open(d, syscall.O_RDONLY, 0)
    	if err != nil {
    		t.Fatalf("Open: %v", err)
    	}
    	defer syscall.Close(fd)
    	var base uintptr
    	var buf [2048]byte
    	for {
    		n, err := syscall.Getdirentries(fd, buf[:], &base)
    		if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  3. src/cmd/pack/pack.go

    	switch op {
    	case 'p':
    		ar = openArchive(os.Args[2], os.O_RDONLY, os.Args[3:])
    		ar.scan(ar.printContents)
    	case 'r':
    		ar = openArchive(os.Args[2], os.O_RDWR|os.O_CREATE, os.Args[3:])
    		ar.addFiles()
    	case 'c':
    		ar = openArchive(os.Args[2], os.O_RDWR|os.O_TRUNC|os.O_CREATE, os.Args[3:])
    		ar.addPkgdef()
    		ar.addFiles()
    	case 't':
    		ar = openArchive(os.Args[2], os.O_RDONLY, os.Args[3:])
    		ar.scan(ar.tableOfContents)
    	case 'x':
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 19:41:17 UTC 2024
    - 8.2K bytes
    - Viewed (0)
  4. src/os/file.go

    )
    
    // Flags to OpenFile wrapping those of the underlying system. Not all
    // flags may be implemented on a given system.
    const (
    	// Exactly one of O_RDONLY, O_WRONLY, or O_RDWR must be specified.
    	O_RDONLY int = syscall.O_RDONLY // open the file read-only.
    	O_WRONLY int = syscall.O_WRONLY // open the file write-only.
    	O_RDWR   int = syscall.O_RDWR   // open the file read-write.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 23:07:37 UTC 2024
    - 25.4K bytes
    - Viewed (0)
  5. src/os/removeall_at.go

    // The contents of this file are not relevant for test caching.
    func openDirAt(dirfd int, name string) (*File, error) {
    	var r int
    	for {
    		var e error
    		r, e = unix.Openat(dirfd, name, O_RDONLY|syscall.O_CLOEXEC|syscall.O_DIRECTORY|syscall.O_NOFOLLOW, 0)
    		if e == nil {
    			break
    		}
    
    		// See comment in openFileNolog.
    		if e == syscall.EINTR {
    			continue
    		}
    
    		return nil, e
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 11 17:09:26 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  6. src/syscall/fs_wasip1.go

    	}
    	if (openmode & O_TRUNC) != 0 {
    		oflags |= OFLAG_TRUNC
    	}
    	if (openmode & O_EXCL) != 0 {
    		oflags |= OFLAG_EXCL
    	}
    
    	var rights rights
    	switch openmode & (O_RDONLY | O_WRONLY | O_RDWR) {
    	case O_RDONLY:
    		rights = fileRights & ^writeRights
    	case O_WRONLY:
    		rights = fileRights & ^readRights
    	case O_RDWR:
    		rights = fileRights
    	}
    
    	var fdflags fdflags
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 19:57:43 UTC 2024
    - 24.1K bytes
    - Viewed (0)
  7. src/syscall/syscall_darwin.go

    	// Just Dup'ing the file descriptor is not enough, as the
    	// result shares underlying state. Use openat to make a really
    	// new file descriptor referring to the same directory.
    	fd2, err := openat(fd, ".", O_RDONLY, 0)
    	if err != nil {
    		return 0, err
    	}
    	d, err := fdopendir(fd2)
    	if err != nil {
    		Close(fd2)
    		return 0, err
    	}
    	defer closedir(d)
    
    	var cnt int64
    	for {
    		var entry Dirent
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:16:50 UTC 2024
    - 11K bytes
    - Viewed (0)
  8. src/cmd/go/internal/fsys/fsys.go

    	}
    
    	return path, false
    }
    
    // Open opens the file at or overlaid on the given path.
    func Open(path string) (*os.File, error) {
    	Trace("Open", path)
    	return openFile(path, os.O_RDONLY, 0)
    }
    
    func openFile(path string, flag int, perm os.FileMode) (*os.File, error) {
    	cpath := canonicalize(path)
    	if node, ok := overlay[cpath]; ok {
    		// Opening a file in the overlay.
    		if node.isDir() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 18:35:34 UTC 2024
    - 22.7K bytes
    - Viewed (0)
  9. src/main/java/jcifs/smb/SmbFile.java

                    throw new SmbUnsupportedOperationException("Not supported without CAP_NT_SMBS");
                }
                return new SmbWatchHandleImpl(openUnshared(O_RDONLY, READ_CONTROL | GENERIC_READ, DEFAULT_SHARING, 0, 1), filter, recursive);
            }
        }
    
    
        @Override
        public boolean canRead () throws SmbException {
    Registered: Wed Jun 12 15:45:55 UTC 2024
    - Last Modified: Thu May 23 01:50:13 UTC 2024
    - 82.3K bytes
    - Viewed (1)
  10. src/net/sendfile_test.go

    		defer wg.Done()
    
    		conn, err := ln.Accept()
    		if err != nil {
    			b.Errorf("failed to accept: %v", err)
    			return
    		}
    		defer conn.Close()
    
    		f, err := os.OpenFile(fileName, os.O_RDONLY, 0660)
    		if err != nil {
    			b.Errorf("failed to open file: %v", err)
    			return
    		}
    		defer f.Close()
    
    		for {
    			if ctx.Err() != nil {
    				return
    			}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 18:12:56 UTC 2024
    - 12.1K bytes
    - Viewed (0)
Back to top