MCPcopy
hub / github.com/bitfield/script / File

Function File

script.go:71–77  ·  view source on GitHub ↗

File creates a pipe that reads from the file path.

(path string)

Source from the content-addressed store, hash-verified

69
70// File creates a pipe that reads from the file path.
71func File(path string) *Pipe {
72 f, err := os.Open(path)
73 if err != nil {
74 return NewPipe().WithError(err)
75 }
76 return NewPipe().WithReader(f)
77}
78
79// FindFiles creates a pipe listing all the files in the directory dir and its
80// subdirectories recursively, one per line, like Unix find(1).

Calls 3

NewPipeFunction · 0.85
WithErrorMethod · 0.80
WithReaderMethod · 0.80

Used in the wild real call sites across dependent graphs

searching dependent graphs…