Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 30 for ErrInvalid (5.06 sec)

  1. src/os/stat_unix.go

    import (
    	"syscall"
    )
    
    // Stat returns the [FileInfo] structure describing file.
    // If there is an error, it will be of type [*PathError].
    func (f *File) Stat() (FileInfo, error) {
    	if f == nil {
    		return nil, ErrInvalid
    	}
    	var fs fileStat
    	err := f.pfd.Fstat(&fs.sys)
    	if err != nil {
    		return nil, f.wrapErr("stat", err)
    	}
    	fillFileStatFromSys(&fs, f.name)
    	return &fs, nil
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 22:38:03 UTC 2024
    - 1.2K bytes
    - Viewed (0)
  2. cmd/kubeadm/app/phases/kubeconfig/kubeconfig.go

    	if kubeConfigDir == "" {
    		return errors.Errorf("%s: kubeConfigDir was empty", errInvalid)
    	}
    	if kubeadmConfig == nil {
    		return errors.Errorf("%s: kubeadmConfig was nil", errInvalid)
    	}
    	if name == "" {
    		return errors.Errorf("%s: name was empty", errInvalid)
    	}
    	if spec == nil {
    		return errors.Errorf("%s: spec was nil", errInvalid)
    	}
    	kubeConfigPath := filepath.Join(kubeConfigDir, name)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jun 07 17:04:18 UTC 2024
    - 27K bytes
    - Viewed (0)
  3. src/io/fs/sub.go

    // chroot-style security mechanism, and Sub does not change that fact.
    func Sub(fsys FS, dir string) (FS, error) {
    	if !ValidPath(dir) {
    		return nil, &PathError{Op: "sub", Path: dir, Err: ErrInvalid}
    	}
    	if dir == "." {
    		return fsys, nil
    	}
    	if fsys, ok := fsys.(SubFS); ok {
    		return fsys.Sub(dir)
    	}
    	return &subFS{fsys, dir}, nil
    }
    
    type subFS struct {
    	fsys FS
    	dir  string
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Feb 10 02:10:17 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  4. internal/lock/lock_test.go

    	if !isClosed {
    		t.Fatal("File ref count should be zero")
    	}
    
    	// Closing a file again should result in invalid argument.
    	if err = rlk.Close(); err != os.ErrInvalid {
    		t.Fatal(err)
    	}
    
    	_, err = newRLockedFile(nil)
    	if err != os.ErrInvalid {
    		t.Fatal("Unexpected error", err)
    	}
    }
    
    // Tests lock and unlock semantics.
    func TestLockAndUnlock(t *testing.T) {
    	f, err := os.CreateTemp("", "lock")
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Sep 19 18:05:16 UTC 2022
    - 3.6K bytes
    - Viewed (0)
  5. src/os/file_mutex_plan9.go

    // is already closed. This method is on File so that we can incorporate
    // a nil test.
    func (f *File) incref(op string) (err error) {
    	if f == nil {
    		return ErrInvalid
    	}
    	if !f.fdmu.Incref() {
    		err = ErrClosed
    		if op != "" {
    			err = &PathError{Op: op, Path: f.name, Err: err}
    		}
    	}
    	return err
    }
    
    // decref removes a reference to the file. If this is the last
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Oct 08 03:57:40 UTC 2022
    - 1.8K bytes
    - Viewed (0)
  6. src/testing/fstest/testfs_test.go

    type failPermFS struct{}
    
    func (f failPermFS) Open(name string) (fs.File, error) {
    	if !fs.ValidPath(name) {
    		return nil, &fs.PathError{Op: "open", Path: name, Err: fs.ErrInvalid}
    	}
    	return nil, &fs.PathError{Op: "open", Path: name, Err: fs.ErrPermission}
    }
    
    func TestTestFSWrappedErrors(t *testing.T) {
    	err := TestFS(failPermFS{})
    	if err == nil {
    		t.Fatal("error expected")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  7. src/os/exec_plan9.go

    func (p *Process) kill() error {
    	return p.signal(Kill)
    }
    
    func (p *Process) wait() (ps *ProcessState, err error) {
    	var waitmsg syscall.Waitmsg
    
    	switch p.pidStatus() {
    	case statusReleased:
    		return nil, ErrInvalid
    	}
    
    	err = syscall.WaitProcess(p.Pid, &waitmsg)
    	if err != nil {
    		return nil, NewSyscallError("wait", err)
    	}
    
    	p.pidDeactivate(statusDone)
    	ps = &ProcessState{
    		pid:    waitmsg.Pid,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 22:06:47 UTC 2024
    - 3.4K bytes
    - Viewed (0)
  8. src/embed/embed.go

    		return 0, &fs.PathError{Op: "seek", Path: f.f.name, Err: fs.ErrInvalid}
    	}
    	f.offset = offset
    	return offset, nil
    }
    
    func (f *openFile) ReadAt(b []byte, offset int64) (int, error) {
    	if offset < 0 || offset > int64(len(f.f.data)) {
    		return 0, &fs.PathError{Op: "read", Path: f.f.name, Err: fs.ErrInvalid}
    	}
    	n := copy(b, f.f.data[offset:])
    	if n < len(b) {
    		return n, io.EOF
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 19:42:51 UTC 2024
    - 13.5K bytes
    - Viewed (0)
  9. src/os/file_posix.go

    // be canceled and return immediately with an [ErrClosed] error.
    // Close will return an error if it has already been called.
    func (f *File) Close() error {
    	if f == nil {
    		return ErrInvalid
    	}
    	return f.file.close()
    }
    
    // read reads up to len(b) bytes from the File.
    // It returns the number of bytes read and an error, if any.
    func (f *File) read(b []byte) (n int, err error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:33:12 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  10. cmd/kubeadm/app/phases/certs/certlist.go

    }
    
    func createKeyAndCSR(kubeadmConfig *kubeadmapi.InitConfiguration, cert *KubeadmCert) error {
    	if kubeadmConfig == nil {
    		return errors.Errorf("%s: kubeadmConfig was nil", errInvalid)
    	}
    	if cert == nil {
    		return errors.Errorf("%s: cert was nil", errInvalid)
    	}
    	certDir := kubeadmConfig.CertificatesDir
    	name := cert.BaseName
    	if pkiutil.CSROrKeyExist(certDir, name) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 01 16:01:49 UTC 2024
    - 15.8K bytes
    - Viewed (0)
Back to top