spacedrive/.tasks/FILE-001-file-copy-job.md
2025-09-06 21:00:37 -04:00

1.2 KiB

id, title, status, assignee, parent, priority, tags, whitepaper
id title status assignee parent priority tags whitepaper
FILE-001 File Copy Job with Strategy Pattern Done james FILE-000 High
core
jobs
file-ops
vdfs
Section 4.4.6

Description

A flexible FileCopyJob will be implemented to handle all copy and move operations. It uses a strategy pattern to select the optimal file transfer method (e.g., local move, cross-volume stream, remote transfer) based on the source and destination SdPath.

Implementation Notes

  • The FileCopyJob and CopyOptions will be defined in src/operations/files/copy/job.rs.
  • The CopyStrategyRouter in src/operations/files/copy/routing.rs selects the appropriate strategy.
  • Implement strategies include LocalMoveStrategy, LocalStreamCopyStrategy, and RemoteTransferStrategy in src/operations/files/copy/strategy.rs.
  • The job provides detailed, byte-level progress updates.

Acceptance Criteria

  • The job can copy files and directories locally.
  • The job correctly selects an atomic rename for same-volume moves.
  • The job can orchestrate a cross-device transfer between two peers.
  • The job correctly handles delete_after_copy for move operations.