Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 145 for O_RDONLY (0.23 sec)

  1. src/os/getwd.go

    	// adds /name to the beginning of dir.
    	dir = ""
    	for parent := ".."; ; parent = "../" + parent {
    		if len(parent) >= 1024 { // Sanity check
    			return "", syscall.ENAMETOOLONG
    		}
    		fd, err := openFileNolog(parent, O_RDONLY, 0)
    		if err != nil {
    			return "", err
    		}
    
    		for {
    			names, err := fd.Readdirnames(100)
    			if err != nil {
    				fd.Close()
    				return "", err
    			}
    			for _, name := range names {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 28 06:28:02 UTC 2020
    - 2.5K bytes
    - Viewed (0)
  2. cmd/os_unix.go

    			return osErrToFileErr(err)
    		}
    		// There may be permission error when dirPath
    		// is at the root of the disk mount that may
    		// not have the permissions to avoid 'noatime'
    		fd, err = openFileWithFD(dirPath, os.O_RDONLY, 0o666)
    		if err != nil {
    			if osErrToFileErr(err) == errFileNotFound {
    				return nil
    			}
    			return osErrToFileErr(err)
    		}
    
    	}
    	defer syscall.Close(fd)
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Jan 18 07:03:17 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  3. src/cmd/go/internal/lockedfile/mutex.go

    	// file at mu.Path is write-only, the call to OpenFile will fail with a
    	// permission error. That's actually what we want: if we add an RLock method
    	// in the future, it should call OpenFile with O_RDONLY and will require the
    	// files must be readable, so we should not let the caller make any
    	// assumptions about Mutex working with write-only files.
    	f, err := OpenFile(mu.Path, os.O_RDWR|os.O_CREATE, 0666)
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 17:17:40 UTC 2019
    - 2.3K bytes
    - Viewed (0)
  4. internal/lock/lock.go

    	}, nil
    }
    
    // RLockedOpenFile - returns a wrapped read locked file, if the file
    // doesn't exist at path returns an error.
    func RLockedOpenFile(path string) (*RLockedFile, error) {
    	lkFile, err := LockedOpenFile(path, os.O_RDONLY, 0o666)
    	if err != nil {
    		return nil, err
    	}
    
    	return newRLockedFile(lkFile)
    }
    
    // LockedFile represents a locked file
    type LockedFile struct {
    	*os.File
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sun Jan 02 17:15:06 UTC 2022
    - 2.5K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/sys/plan9/syscall_plan9.go

    }
    
    // Implemented in assembly to import from runtime.
    func exit(code int)
    
    func Exit(code int) { exit(code) }
    
    func readnum(path string) (uint, error) {
    	var b [12]byte
    
    	fd, e := Open(path, O_RDONLY)
    	if e != nil {
    		return 0, e
    	}
    	defer Close(fd)
    
    	n, e := Pread(fd, b[:], 0)
    
    	if e != nil {
    		return 0, e
    	}
    
    	m := 0
    	for ; m < n && b[m] == ' '; m++ {
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 16 22:24:28 UTC 2022
    - 7K bytes
    - Viewed (0)
  6. 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)
  7. src/syscall/syscall_plan9.go

    	buf[len(buf)-1] = 0
    	return cstring(buf[:])
    }
    
    func readnum(path string) (uint, error) {
    	var b [12]byte
    
    	fd, e := Open(path, O_RDONLY)
    	if e != nil {
    		return 0, e
    	}
    	defer Close(fd)
    
    	n, e := Pread(fd, b[:], 0)
    
    	if e != nil {
    		return 0, e
    	}
    
    	m := 0
    	for ; m < n && b[m] == ' '; m++ {
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:03:59 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  8. src/go/printer/testdata/linebreaks.golden

    			"	godoc -http=:6060\n")
    	flag.PrintDefaults()
    	os.Exit(2)
    }
    
    func TestReader(t *testing.T) {
    testLoop:
    	for i, test := range untarTests {
    		f, err := os.Open(test.file, os.O_RDONLY, 0444)
    		if err != nil {
    			t.Errorf("test %d: Unexpected error: %v", i, err)
    			continue
    		}
    		tr := NewReader(f)
    		for j, header := range test.headers {
    			hdr, err := tr.Next()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 11 22:03:18 UTC 2018
    - 5.1K bytes
    - Viewed (0)
  9. src/main/java/jcifs/smb/SmbCopyUtil.java

                    log.warn("Server side copy failed", e);
                    throw SmbException.wrap(e);
                }
            }
    
            try ( SmbFileHandleImpl sfd = src.openUnshared(0, SmbConstants.O_RDONLY, SmbConstants.FILE_SHARE_READ, SmbConstants.ATTR_NORMAL, 0);
                  SmbFileInputStream fis = new SmbFileInputStream(src, sh, sfd) ) {
                int attrs = src.getAttributes();
    
    Registered: Wed Jun 12 15:45:55 UTC 2024
    - Last Modified: Tue Jul 07 10:52:42 UTC 2020
    - 17.1K bytes
    - Viewed (0)
  10. src/main/java/jcifs/smb/SmbFileInputStream.java

         */
        @SuppressWarnings ( "resource" )
        public SmbFileInputStream ( String url, CIFSContext tc ) throws SmbException, MalformedURLException {
            this(new SmbFile(url, tc), 0, SmbConstants.O_RDONLY, SmbConstants.DEFAULT_SHARING, true);
        }
    
    
        /**
         * Creates an {@link java.io.InputStream} for reading bytes from a file on
         * an SMB server represented by the {@link jcifs.smb.SmbFile} parameter. See
    Registered: Wed Jun 12 15:45:55 UTC 2024
    - Last Modified: Sun May 17 08:55:14 UTC 2020
    - 13.2K bytes
    - Viewed (0)
Back to top