- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 25 for DirEntry (2.25 sec)
-
src/io/fs/readdir.go
ReadDir(name string) ([]DirEntry, error) } // ReadDir reads the named directory // and returns a list of directory entries sorted by filename. // // If fs implements [ReadDirFS], ReadDir calls fs.ReadDir. // Otherwise ReadDir calls fs.Open and uses ReadDir and Close // on the returned file. func ReadDir(fsys FS, name string) ([]DirEntry, error) { if fsys, ok := fsys.(ReadDirFS); ok {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 1.9K bytes - Viewed (0) -
src/os/dir.go
names = []string{} } return names, err } // A DirEntry is an entry read from a directory // (using the [ReadDir] function or a [File.ReadDir] method). type DirEntry = fs.DirEntry // ReadDir reads the contents of the directory associated with the file f // and returns a slice of [DirEntry] values in directory order. // Subsequent calls on the same file will yield later DirEntry records in the directory. //
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: "read", Path: d.path, Err: fs.ErrInvalid} } func (d *mapDir) ReadDir(count int) ([]fs.DirEntry, error) { n := len(d.entry) - d.offset if n == 0 && count > 0 { return nil, io.EOF } if count > 0 && n > count { n = count } list := make([]fs.DirEntry, n) for i := range list { list[i] = &d.entry[d.offset+i] } d.offset += n return list, nil
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/embed/embed.go
) // A file is a single file in the FS. // It implements fs.FileInfo and fs.DirEntry. type file struct { // The compiler knows the layout of this struct. // See cmd/compile/internal/staticdata's WriteEmbed. name string data string hash [16]byte // truncated SHA256 hash } var ( _ fs.FileInfo = (*file)(nil) _ fs.DirEntry = (*file)(nil) )
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon May 20 19:42:51 UTC 2024 - 13.5K bytes - Viewed (0) -
src/testing/fstest/testfs_test.go
f, err := MapFS(fsys).Open(name) if err != nil { return nil, err } return &shuffledFile{File: f}, nil } type shuffledFile struct{ fs.File } func (f *shuffledFile) ReadDir(n int) ([]fs.DirEntry, error) { dirents, err := f.File.(fs.ReadDirFile).ReadDir(n) // Shuffle in a deterministic way, all we care about is making sure that the // list of directory entries is not is the lexicographic order. //
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/testing/fstest/testfs.go
// The order of the lists need not match. func (t *fsTester) checkDirList(dir, desc string, list1, list2 []fs.DirEntry) { old := make(map[string]fs.DirEntry) checkMode := func(entry fs.DirEntry) { if entry.IsDir() != (entry.Type()&fs.ModeDir != 0) { if entry.IsDir() { t.errorf("%s: ReadDir returned %s with IsDir() = true, Type() & ModeDir = 0", dir, entry.Name())
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 16.3K bytes - Viewed (0) -
src/cmd/fix/main.go
} func walkDir(path string) { filepath.WalkDir(path, visitFile) } func visitFile(path string, f fs.DirEntry, err error) error { if err == nil && isGoFile(f) { err = processFile(path, false) } if err != nil { report(err) } return nil } func isGoFile(f fs.DirEntry) bool { // ignore non-Go files name := f.Name()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 14 19:41:17 UTC 2024 - 5.4K bytes - Viewed (0) -
src/io/ioutil/ioutil.go
// ReadDir returns no directory entries along with the error. // // Deprecated: As of Go 1.16, [os.ReadDir] is a more efficient and correct choice: // it returns a list of [fs.DirEntry] instead of [fs.FileInfo], // and it returns partial results in the case of an error // midway through reading a directory. // // If you must continue obtaining a list of [fs.FileInfo], you still can: //
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 3.2K bytes - Viewed (0) -
src/os/dir_unix.go
return &buf }, } func (d *dirInfo) close() { if d.buf != nil { dirBufPool.Put(d.buf) d.buf = nil } } func (f *File) readdir(n int, mode readdirMode) (names []string, dirents []DirEntry, infos []FileInfo, err error) { // If this file has no dirInfo, create one. d := f.dirinfo.Load() if d == nil { d = new(dirInfo) f.dirinfo.Store(d) } d.mu.Lock() defer d.mu.Unlock()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 14 20:11:45 UTC 2024 - 4.8K bytes - Viewed (0) -
src/cmd/gofmt/gofmt.go
// It's only -r that makes use of go/ast's object resolution, // so avoid the unnecessary work if the flag isn't used. if *rewriteRule == "" { parserMode |= parser.SkipObjectResolution } } func isGoFile(f fs.DirEntry) bool { // ignore non-Go files name := f.Name() return !strings.HasPrefix(name, ".") && strings.HasSuffix(name, ".go") && !f.IsDir() } // A sequencer performs concurrent tasks that may write output, but emits that
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 14 19:41:17 UTC 2024 - 15.1K bytes - Viewed (0)