- Sort Score
- Result 10 results
- Languages All
Results 1 - 9 of 9 for ErrInvalid (0.89 sec)
-
src/os/error.go
// // Errors returned from this package may be tested against these errors // with [errors.Is]. var ( // ErrInvalid indicates an invalid argument. // Methods on File will return this error when the receiver is nil. ErrInvalid = fs.ErrInvalid // "invalid argument" ErrPermission = fs.ErrPermission // "permission denied" ErrExist = fs.ErrExist // "file already exists"
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Feb 26 21:33:12 UTC 2024 - 4.8K bytes - Viewed (0) -
src/os/dir.go
// and a non-nil error. // // Most clients are better served by the more efficient ReadDir method. func (f *File) Readdir(n int) ([]FileInfo, error) { if f == nil { return nil, ErrInvalid } _, _, infos, err := f.readdir(n, readdirFileInfo) if infos == nil { // Readdir has historically always returned a non-nil empty slice, never nil, // even on error (except misuse with nil receiver above).
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 6.1K bytes - Viewed (0) -
src/testing/fstest/mapfs.go
return 0, &fs.PathError{Op: "seek", Path: f.path, Err: fs.ErrInvalid} } f.offset = offset return offset, nil } func (f *openMapFile) ReadAt(b []byte, offset int64) (int, error) { if offset < 0 || offset > int64(len(f.f.Data)) { return 0, &fs.PathError{Op: "read", Path: f.path, 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: Thu May 23 01:00:11 UTC 2024 - 7.1K bytes - Viewed (0) -
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) -
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) -
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) -
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) -
cni/pkg/nodeagent/fakes_test.go
// and the Err field describing the problem. // // Open should reject attempts to open names that do not satisfy // ValidPath(name), returning a *PathError with Err set to // ErrInvalid or ErrNotExist. func (ffs *fakeFsWithFakeFds) Open(name string) (fs.File, error) { f, err := ffs.ReadDirFS.Open(name) if err != nil { return nil, err } return wrapFile(f), nil }
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Fri Apr 12 21:47:31 UTC 2024 - 3.9K bytes - Viewed (0) -
src/os/stat_windows.go
"unsafe" ) // Stat returns the [FileInfo] structure describing file. // If there is an error, it will be of type [*PathError]. func (file *File) Stat() (FileInfo, error) { if file == nil { return nil, ErrInvalid } return statHandle(file.name, file.pfd.Sysfd) } // stat implements both Stat and Lstat of a file. func stat(funcname, name string, followSurrogates bool) (FileInfo, error) { if len(name) == 0 {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 07 18:44:48 UTC 2024 - 5.2K bytes - Viewed (0)