Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 79 for DirEntry (1.64 sec)

  1. src/crypto/x509/root_unix.go

    		return roots, nil
    	}
    
    	return nil, firstErr
    }
    
    // readUniqueDirectoryEntries is like os.ReadDir but omits
    // symlinks that point within the directory.
    func readUniqueDirectoryEntries(dir string) ([]fs.DirEntry, error) {
    	files, err := os.ReadDir(dir)
    	if err != nil {
    		return nil, err
    	}
    	uniq := files[:0]
    	for _, f := range files {
    		if !isSameDirSymlink(f, dir) {
    			uniq = append(uniq, f)
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 11 20:54:07 UTC 2023
    - 2.7K bytes
    - Viewed (0)
  2. src/io/fs/format.go

    	}
    
    	return string(b)
    }
    
    // FormatDirEntry returns a formatted version of dir for human readability.
    // Implementations of [DirEntry] can call this from a String method.
    // The outputs for a directory named subdir and a file named hello.go are:
    //
    //	d subdir/
    //	- hello.go
    func FormatDirEntry(dir DirEntry) string {
    	name := dir.Name()
    	b := make([]byte, 0, 5+len(name))
    
    	// The Type method does not return any permission bits,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 18 19:34:35 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. src/cmd/go/internal/toolchain/path_none.go

    }
    
    // pathVersion returns the Go version implemented by the file
    // described by de and info in directory dir.
    // The analysis only uses the name itself; it does not run the program.
    func pathVersion(dir string, de fs.DirEntry, info fs.FileInfo) (string, bool) {
    	return "", false
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 31 15:15:19 UTC 2023
    - 620 bytes
    - Viewed (0)
  8. src/cmd/go/internal/toolchain/path_plan9.go

    }
    
    // pathVersion returns the Go version implemented by the file
    // described by de and info in directory dir.
    // The analysis only uses the name itself; it does not run the program.
    func pathVersion(dir string, de fs.DirEntry, info fs.FileInfo) (string, bool) {
    	v := gover.FromToolchain(de.Name())
    	if v == "" || info.Mode()&0111 == 0 {
    		return "", false
    	}
    	return v, true
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 31 15:15:19 UTC 2023
    - 764 bytes
    - Viewed (0)
  9. 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)
  10. pkg/kubelet/container/testing/os.go

    // If a member of the form `*Fn` is set, that function will be called in place
    // of the real call.
    type FakeOS struct {
    	StatFn     func(string) (os.FileInfo, error)
    	ReadDirFn  func(string) ([]os.DirEntry, error)
    	MkdirAllFn func(string, os.FileMode) error
    	SymlinkFn  func(string, string) error
    	GlobFn     func(string, string) bool
    	HostName   string
    	Removes    []string
    	Files      map[string][]*os.FileInfo
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Feb 07 13:37:31 UTC 2023
    - 3.7K bytes
    - Viewed (0)
Back to top