Pad/internal/io/pool/filesystem.go
Greg Pomerantz 93a5f879f5 feat: implement atomic writes for filesystem backend
- Add WriteFile method to mock filesystem (non-atomic path, creates files)
- Implement WriteFileAtomic in mock with temp file + rename pattern
  using .tmp/ directory, matching real filesystem semantics
- Update WriteFileTask.Execute() to use WriteFileAtomic
- Update FlushAll() to use WriteFileAtomic
- Fix mock to create files on write (matching os.WriteFile behavior)
- Update tests to match new semantics (create-if-not-exists)
2026-06-04 18:01:51 -04:00

17 lines
476 B
Go

package pool
import "pad/internal/io/pool/types"
// FileSystem defines the interface for filesystem operations
// used by the worker pool.
type FileSystem interface {
ReadDir(path string) ([]types.DirEntry, error)
DirExists(path string) bool
FileExists(path string) bool
ReadFile(path string) ([]byte, error)
WriteFile(path string, content []byte) error
WriteFileAtomic(path string, content []byte) error
DeleteFile(path string) error
CreateDir(path string) error
}