MCPcopy Create free account
hub / github.com/alibaba/open-code-review / validateWorkspaceFileMode

Function validateWorkspaceFileMode

internal/tool/filereader.go:128–134  ·  view source on GitHub ↗
(path string, mode os.FileMode)

Source from the content-addressed store, hash-verified

126}
127
128func validateWorkspaceFileMode(path string, mode os.FileMode) error {
129 // Opening a FIFO can block before a reader is available to observe cancellation.
130 if mode&os.ModeNamedPipe != 0 {
131 return fmt.Errorf("file %q is a named pipe", path)
132 }
133 return nil
134}
135
136func (fr *FileReader) readFromGitShow(parentCtx context.Context, path string) (string, error) {
137 ctx, cancel := context.WithTimeout(parentCtx, 30*time.Second)

Callers 2

resolveWorkspacePathMethod · 0.85

Calls

no outgoing calls

Tested by 1