mirror of
https://github.com/samuelncui/yatm.git
synced 2026-11-08 04:18:03 +00:00
Use the common temporary root for Library, Restore probes, Preview and script output. Preserve active ownership, ordinary outputs and retryable cleanup failures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
545 B
Go
23 lines
545 B
Go
package fileops
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/samuelncui/yatm/internal/executor"
|
|
"github.com/samuelncui/yatm/internal/resource"
|
|
)
|
|
|
|
type operation struct {
|
|
*resource.TemporaryDB
|
|
exe *executor.Executor
|
|
}
|
|
|
|
func newOperation(ctx context.Context, exe *executor.Executor) (*operation, error) {
|
|
// The request owns its disposable manifest through result delivery.
|
|
temporary, err := resource.OpenTemporaryDB(exe.Paths().Work, "file-operation-")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &operation{TemporaryDB: temporary, exe: exe}, nil
|
|
}
|