Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 61 for DirEntry (0.32 sec)

  1. src/compress/gzip/issue14937_test.go

    	}
    
    	goroot, err := filepath.EvalSymlinks(runtime.GOROOT())
    	if err != nil {
    		t.Fatal("error evaluating GOROOT: ", err)
    	}
    	var files []string
    	err = filepath.WalkDir(goroot, func(path string, info fs.DirEntry, err error) error {
    		if err != nil {
    			return err
    		}
    		if !info.IsDir() && strings.HasSuffix(path, ".gz") {
    			files = append(files, path)
    		}
    		return nil
    	})
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 10 16:37:53 UTC 2024
    - 2K bytes
    - Viewed (0)
  2. src/cmd/go/internal/modcmd/vendor.go

    func matchMetadata(dir string, info fs.DirEntry) bool {
    	name := info.Name()
    	for _, p := range metaPrefixes {
    		if strings.HasPrefix(name, p) {
    			return true
    		}
    	}
    	return false
    }
    
    // matchPotentialSourceFile reports whether info may be relevant to a build operation.
    func matchPotentialSourceFile(dir string, info fs.DirEntry) bool {
    	if strings.HasSuffix(info.Name(), "_test.go") {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 14 14:19:59 UTC 2024
    - 14.5K bytes
    - Viewed (0)
  3. cni/pkg/nodeagent/podcgroupns.go

    	uid     types.UID
    	netns   fs.File
    	netnsfd uintptr
    	inode   uint64
    }
    
    func (p *PodNetnsProcFinder) processEntry(proc fs.FS, netnsObserved sets.Set[uint64], filter sets.Set[types.UID], entry fs.DirEntry) (*PodNetnsEntry, error) {
    	if !isProcess(entry) {
    		return nil, nil
    	}
    
    	netnsName := path.Join(entry.Name(), "ns", "net")
    	fi, err := fs.Stat(proc, netnsName)
    	if err != nil {
    		return nil, err
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Apr 12 21:47:31 UTC 2024
    - 11K bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. src/cmd/go/testdata/addmod.go

    		a.Files = []txtar.File{
    			{Name: ".mod", Data: mod},
    			{Name: ".info", Data: info},
    		}
    		dir = filepath.Clean(dir)
    		err = filepath.WalkDir(dir, func(path string, info fs.DirEntry, err error) error {
    			if !info.Type().IsRegular() {
    				return nil
    			}
    			name := info.Name()
    			if name == "go.mod" || strings.HasSuffix(name, ".go") {
    				data, err := os.ReadFile(path)
    				if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 30 19:41:54 UTC 2023
    - 3.5K bytes
    - Viewed (0)
  7. src/cmd/gofmt/long_test.go

    		testFile(t, b1, b2, filename)
    	}
    	done <- 0
    }
    
    func genFilenames(t *testing.T, filenames chan<- string) {
    	defer close(filenames)
    
    	handleFile := func(filename string, d fs.DirEntry, err error) error {
    		if err != nil {
    			t.Error(err)
    			return nil
    		}
    		// don't descend into testdata directories
    		if isGoFile(d) && !strings.Contains(filepath.ToSlash(filename), "/testdata/") {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 20:27:28 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  8. src/io/fs/sub.go

    	full, err := f.fullName("open", name)
    	if err != nil {
    		return nil, err
    	}
    	file, err := f.fsys.Open(full)
    	return file, f.fixErr(err)
    }
    
    func (f *subFS) ReadDir(name string) ([]DirEntry, error) {
    	full, err := f.fullName("read", name)
    	if err != nil {
    		return nil, err
    	}
    	dir, err := ReadDir(f.fsys, full)
    	return dir, f.fixErr(err)
    }
    
    func (f *subFS) ReadFile(name string) ([]byte, error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Feb 10 02:10:17 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  9. 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)
  10. 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)
Back to top