Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for DirEntry (1.25 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. pkg/kubelet/container/testing/mockdirentry.go

    limitations under the License.
    */
    
    // Code generated by MockGen.
    // Source: os (interfaces: DirEntry)
    
    package testing
    
    import (
    	fs "io/fs"
    	reflect "reflect"
    
    	gomock "go.uber.org/mock/gomock"
    )
    
    // MockDirEntry is a mock of DirEntry interface.
    type MockDirEntry struct {
    	ctrl     *gomock.Controller
    	recorder *MockDirEntryMockRecorder
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 08:12:16 UTC 2024
    - 3K bytes
    - Viewed (0)
  6. 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)
  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/mapfs_test.go

    }
    
    func TestMapFSChmodDot(t *testing.T) {
    	m := MapFS{
    		"a/b.txt": &MapFile{Mode: 0666},
    		".":       &MapFile{Mode: 0777 | fs.ModeDir},
    	}
    	buf := new(strings.Builder)
    	fs.WalkDir(m, ".", func(path string, d fs.DirEntry, err error) error {
    		fi, err := d.Info()
    		if err != nil {
    			return err
    		}
    		fmt.Fprintf(buf, "%s: %v\n", path, fi.Mode())
    		return nil
    	})
    	want := `
    .: drwxrwxrwx
    a: dr-xr-xr-x
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 20 14:59:55 UTC 2024
    - 1.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. lib/time/mkzip.go

    	if len(args) != 1 || !strings.HasSuffix(args[0], ".zip") {
    		usage()
    	}
    
    	var zb bytes.Buffer
    	zw := zip.NewWriter(&zb)
    	seen := make(map[string]bool)
    	err := filepath.WalkDir(".", func(path string, d fs.DirEntry, err error) error {
    		if d.IsDir() {
    			return nil
    		}
    		data, err := os.ReadFile(path)
    		if err != nil {
    			log.Fatal(err)
    		}
    		if strings.HasSuffix(path, ".zip") {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:32:07 UTC 2024
    - 2.1K bytes
    - Viewed (0)
Back to top