Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 79 for DirEntry (0.87 sec)

  1. src/cmd/go/internal/version/version.go

    			scanDir(arg)
    		} else {
    			scanFile(arg, info, true)
    		}
    	}
    }
    
    // scanDir scans a directory for binary to run scanFile on.
    func scanDir(dir string) {
    	filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error {
    		if d.Type().IsRegular() || d.Type()&fs.ModeSymlink != 0 {
    			info, err := d.Info()
    			if err != nil {
    				if *versionV {
    					fmt.Fprintf(os.Stderr, "%s: %v\n", path, err)
    				}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 24 19:27:00 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  2. 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)
  3. pkg/util/filesystem/defaultfs.go

    	file, err := os.CreateTemp(fs.prefix(dir), prefix)
    	if err != nil {
    		return nil, err
    	}
    	return &defaultFile{file}, nil
    }
    
    // ReadDir via os.ReadDir
    func (fs *DefaultFs) ReadDir(dirname string) ([]os.DirEntry, error) {
    	return os.ReadDir(fs.prefix(dirname))
    }
    
    // Walk via filepath.Walk
    func (fs *DefaultFs) Walk(root string, walkFn filepath.WalkFunc) error {
    	return filepath.Walk(fs.prefix(root), walkFn)
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 03 07:38:14 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  4. src/net/http/http_test.go

    	if !testenv.HasSrc() {
    		t.Skip("source code not available")
    	}
    
    	re := regexp.MustCompile(`(strings|bytes).([A-Za-z]+)`)
    	if err := fs.WalkDir(os.DirFS("."), ".", func(path string, d fs.DirEntry, err error) error {
    		if err != nil {
    			t.Fatal(err)
    		}
    
    		if path == "internal/ascii" {
    			return fs.SkipDir
    		}
    		if !strings.HasSuffix(path, ".go") ||
    			strings.HasSuffix(path, "_test.go") ||
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 22 18:18:19 UTC 2023
    - 5.2K bytes
    - Viewed (0)
  5. pkg/kubelet/kuberuntime/kuberuntime_gc_test.go

    	podStateProvider.removed["789"] = struct{}{}
    	podStateProvider.removed["654"] = struct{}{}
    
    	ctrl := gomock.NewController(t)
    	defer ctrl.Finish()
    
    	fakeOS.ReadDirFn = func(string) ([]os.DirEntry, error) {
    		var dirEntries []os.DirEntry
    		for _, file := range files {
    			mockDE := containertest.NewMockDirEntry(ctrl)
    			mockDE.EXPECT().Name().Return(file)
    			dirEntries = append(dirEntries, mockDE)
    		}
    		return dirEntries, nil
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 08:12:16 UTC 2024
    - 20.6K bytes
    - Viewed (0)
  6. src/cmd/distpack/archive.go

    // The archive can be amended afterward using methods like Add and Filter.
    func NewArchive(dir string) (*Archive, error) {
    	a := new(Archive)
    	err := fs.WalkDir(os.DirFS(dir), ".", func(name string, d fs.DirEntry, err error) error {
    		if err != nil {
    			return err
    		}
    		if d.IsDir() {
    			return nil
    		}
    		info, err := d.Info()
    		if err != nil {
    			return err
    		}
    		a.Add(name, filepath.Join(dir, name), info)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 11 17:37:52 UTC 2023
    - 5.9K bytes
    - Viewed (0)
  7. 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)
  8. internal/store/queuestore.go

    	return l, nil
    }
    
    // list will read all entries from disk.
    // Entries are returned sorted by modtime, oldest first.
    // Underlying entry list in store is *not* updated.
    func (store *QueueStore[_]) list() ([]os.DirEntry, error) {
    	files, err := os.ReadDir(store.directory)
    	if err != nil {
    		return nil, err
    	}
    
    	// Sort the entries.
    	sort.Slice(files, func(i, j int) bool {
    		ii, err := files[i].Info()
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Mar 25 16:44:20 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  9. pkg/kubelet/stats/cri_stats_provider_test.go

    	}
    
    	ctrl := gomock.NewController(t)
    	defer ctrl.Finish()
    
    	fakeOS := &kubecontainertest.FakeOS{}
    	fakeOS.ReadDirFn = func(path string) ([]os.DirEntry, error) {
    		var dirEntries []os.DirEntry
    		mockDE := kubecontainertest.NewMockDirEntry(ctrl)
    		switch path {
    		case kuberuntime.BuildPodLogsDirectory(testPodLogDirectory, "sandbox0-ns", "sandbox0-name", types.UID("sandbox0-uid")):
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 25 14:24:16 UTC 2024
    - 54.5K bytes
    - Viewed (0)
  10. src/path/filepath/path_test.go

    	})
    }
    
    // Assumes that each node name is unique. Good enough for a test.
    // If clear is true, any incoming error is cleared before return. The errors
    // are always accumulated, though.
    func mark(d fs.DirEntry, err error, errors *[]error, clear bool) error {
    	name := d.Name()
    	walkTree(tree, tree.name, func(path string, n *Node) {
    		if n.name == name {
    			n.mark++
    		}
    	})
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 22 16:38:19 UTC 2024
    - 47.1K bytes
    - Viewed (0)
Back to top