MCPcopy Create free account
hub / github.com/tailscale/tailscale / runStat

Function runStat

cmd/tailscale/cli/debug.go:740–760  ·  view source on GitHub ↗
(ctx context.Context, args []string)

Source from the content-addressed store, hash-verified

738}
739
740func runStat(ctx context.Context, args []string) error {
741 for _, a := range args {
742 fi, err := os.Lstat(a)
743 if err != nil {
744 printf("%s: %v\n", a, err)
745 continue
746 }
747 printf("%s: %v, %v\n", a, fi.Mode(), fi.Size())
748 if fi.IsDir() {
749 ents, _ := os.ReadDir(a)
750 for i, ent := range ents {
751 if i == 25 {
752 printf(" ...\n")
753 break
754 }
755 printf(" - %s\n", ent.Name())
756 }
757 }
758 }
759 return nil
760}
761
762func runHostinfo(ctx context.Context, args []string) error {
763 hi := hostinfo.New()

Callers

nothing calls this directly

Calls 5

ModeMethod · 0.80
printfFunction · 0.70
NameMethod · 0.65
SizeMethod · 0.45
IsDirMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…