MCPcopy Create free account
hub / github.com/github/copilot-sdk / AppendFile

Method AppendFile

go/internal/e2e/session_fs_e2e_test.go:367–383  ·  view source on GitHub ↗
(path string, content string, mode *int)

Source from the content-addressed store, hash-verified

365}
366
367func (h *testSessionFSHandler) AppendFile(path string, content string, mode *int) error {
368 fullPath := providerPath(h.root, h.sessionID, path)
369 if err := os.MkdirAll(filepath.Dir(fullPath), 0o755); err != nil {
370 return err
371 }
372 perm := os.FileMode(0o666)
373 if mode != nil {
374 perm = os.FileMode(*mode)
375 }
376 f, err := os.OpenFile(fullPath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, perm)
377 if err != nil {
378 return err
379 }
380 defer f.Close()
381 _, err = f.WriteString(content)
382 return err
383}
384
385func (h *testSessionFSHandler) Exists(path string) (bool, error) {
386 _, err := os.Stat(providerPath(h.root, h.sessionID, path))

Callers 1

Calls 2

providerPathFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected