Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 32 for DirEntry (0.57 sec)

  1. src/os/dir_plan9.go

    			if mode == readdirDirEntry {
    				dirents = append(dirents, dirEntry{f})
    			} else {
    				infos = append(infos, f)
    			}
    		}
    		d.bufp += m
    		n--
    	}
    
    	if n > 0 && len(names)+len(dirents)+len(infos) == 0 {
    		return nil, nil, nil, io.EOF
    	}
    	return names, dirents, infos, nil
    }
    
    type dirEntry struct {
    	fs *fileStat
    }
    
    func (de dirEntry) Name() string            { return de.fs.Name() }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 20:52:06 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  2. 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)
  3. 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)
  4. src/os/dir_windows.go

    				if mode == readdirDirEntry {
    					dirents = append(dirents, dirEntry{f})
    				} else {
    					infos = append(infos, f)
    				}
    			}
    			n--
    		}
    	}
    	if !wantAll && len(names)+len(dirents)+len(infos) == 0 {
    		return nil, nil, nil, io.EOF
    	}
    	return names, dirents, infos, nil
    }
    
    type dirEntry struct {
    	fs *fileStat
    }
    
    func (de dirEntry) Name() string            { return de.fs.Name() }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 20:52:06 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. src/os/dir_darwin.go

    }
    
    func (d *dirInfo) close() {
    	if d.dir == 0 {
    		return
    	}
    	closedir(d.dir)
    	d.dir = 0
    }
    
    func (f *File) readdir(n int, mode readdirMode) (names []string, dirents []DirEntry, infos []FileInfo, err error) {
    	// If this file has no dirinfo, create one.
    	var d *dirInfo
    	for {
    		d = f.dirinfo.Load()
    		if d != nil {
    			break
    		}
    		dir, call, errno := f.pfd.OpenDir()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 20:52:06 UTC 2024
    - 3.5K bytes
    - Viewed (0)
Back to top