MCPcopy Create free account
hub / github.com/astercloud/aster / Write

Method Write

pkg/sandbox/cloud/volcengine.go:249–262  ·  view source on GitHub ↗

Write 写入文件

(ctx context.Context, path string, content string)

Source from the content-addressed store, hash-verified

247
248// Write 写入文件
249func (vfs *VolcengineFS) Write(ctx context.Context, path string, content string) error {
250 absPath := vfs.absPath(path)
251
252 _, err := vfs.mcpClient.CallTool(ctx, "computer_write_file", map[string]any{
253 "session_id": vfs.sessionID,
254 "path": absPath,
255 "content": content,
256 })
257 if err != nil {
258 return fmt.Errorf("write file: %w", err)
259 }
260
261 return nil
262}
263
264// Temp 生成临时文件路径
265func (vfs *VolcengineFS) Temp(name string) string {

Callers

nothing calls this directly

Calls 2

absPathMethod · 0.95
CallToolMethod · 0.45

Tested by

no test coverage detected