Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for FormatDirEntry (0.16 sec)

  1. src/io/fs/format_test.go

    		}
    	}
    }
    
    func TestFormatDirEntry(t *testing.T) {
    	for i, test := range formatTests {
    		got := FormatDirEntry(&test.input)
    		if got != test.wantDirEntry {
    			t.Errorf("%d: FormatDirEntry(%#v) = %q, want %q", i, test.input, got, test.wantDirEntry)
    		}
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 02 17:59:28 UTC 2023
    - 2.5K bytes
    - Viewed (0)
  2. src/io/fs/format.go

    	if info.IsDir() {
    		b = append(b, '/')
    	}
    
    	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))
    
    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. src/os/dir_plan9.go

    func (de dirEntry) Type() FileMode          { return de.fs.Mode().Type() }
    func (de dirEntry) Info() (FileInfo, error) { return de.fs, nil }
    
    func (de dirEntry) String() string {
    	return fs.FormatDirEntry(de)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 20:52:06 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  4. src/io/fs/readdir.go

    }
    
    func (di dirInfo) Info() (FileInfo, error) {
    	return di.fileInfo, nil
    }
    
    func (di dirInfo) Name() string {
    	return di.fileInfo.Name()
    }
    
    func (di dirInfo) String() string {
    	return FormatDirEntry(di)
    }
    
    // FileInfoToDirEntry returns a [DirEntry] that returns information from info.
    // If info is nil, FileInfoToDirEntry returns nil.
    func FileInfoToDirEntry(info FileInfo) DirEntry {
    	if info == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  5. src/os/dir_windows.go

    func (de dirEntry) Type() FileMode          { return de.fs.Mode().Type() }
    func (de dirEntry) Info() (FileInfo, error) { return de.fs, nil }
    
    func (de dirEntry) String() string {
    	return fs.FormatDirEntry(de)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 20:52:06 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  6. src/os/file_unix.go

    func (d *unixDirent) Info() (FileInfo, error) {
    	if d.info != nil {
    		return d.info, nil
    	}
    	return lstat(d.parent + "/" + d.name)
    }
    
    func (d *unixDirent) String() string {
    	return fs.FormatDirEntry(d)
    }
    
    func newUnixDirent(parent, name string, typ FileMode) (DirEntry, error) {
    	ude := &unixDirent{
    		parent: parent,
    		name:   name,
    		typ:    typ,
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 13:52:34 UTC 2024
    - 14.9K bytes
    - Viewed (0)
  7. api/go1.21.txt

    pkg go/types, method (*Package) GoVersion() string #61175
    pkg html/template, const ErrJSTemplate = 12 #59584
    pkg html/template, const ErrJSTemplate ErrorCode #59584
    pkg io/fs, func FormatDirEntry(DirEntry) string #54451
    pkg io/fs, func FormatFileInfo(FileInfo) string #54451
    pkg log/slog, const KindAny = 0 #56345
    pkg log/slog, const KindAny Kind #56345
    pkg log/slog, const KindBool = 1 #56345
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 07 09:39:17 UTC 2023
    - 25.6K bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"ErrNotExist", Var, 16},
    		{"ErrPermission", Var, 16},
    		{"FS", Type, 16},
    		{"File", Type, 16},
    		{"FileInfo", Type, 16},
    		{"FileInfoToDirEntry", Func, 17},
    		{"FileMode", Type, 16},
    		{"FormatDirEntry", Func, 21},
    		{"FormatFileInfo", Func, 21},
    		{"Glob", Func, 16},
    		{"GlobFS", Type, 16},
    		{"ModeAppend", Const, 16},
    		{"ModeCharDevice", Const, 16},
    		{"ModeDevice", Const, 16},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
Back to top