--partial — keep partially transferred files on interruption and resume on next run
--partial-dir=DIR — store partial files in a hidden directory instead of alongside destination files
--inplace — update destination files in place instead of writing to a temporary file and renaming
Current FastSync behavior: file_save_to_disk() in src/shared/file.c:129 opens the destination with fopen(path, "wb") and writes directly to the final path. If the transfer is interrupted, the destination is left in a partial/corrupted state and the next run re-transfers from scratch.
Protocol: no wire changes required; purely receiver-side write strategy
Implementation:
Default: write to <dest>.fastsync.tmp and rename() to final name on success
--partial: leave temp file on failure and resume if size matches on next incremental run
--partial-dir: write to <partial-dir>/<relative-path>.fastsync.tmp
--inplace: open existing file for write and overwrite blocks as they arrive (more complex; lower priority)
Priority: high Rationale: Resilience over unreliable networks is a core rsync use case. Without partial resume, large-file transfers over WAN are risky.
Acceptance criteria:
Interrupting a large-file transfer leaves a resumable partial file when --partial is used
Next invocation resumes from the partial file size when --incremental + --partial are combined
--partial-dir isolates temp files from the destination tree
Integration tests cover interruption and resume scenarios
**Corresponding rsync flags/behavior:**
- `--partial` — keep partially transferred files on interruption and resume on next run
- `--partial-dir=DIR` — store partial files in a hidden directory instead of alongside destination files
- `--inplace` — update destination files in place instead of writing to a temporary file and renaming
**Current FastSync behavior:**
`file_save_to_disk()` in `src/shared/file.c:129` opens the destination with `fopen(path, "wb")` and writes directly to the final path. If the transfer is interrupted, the destination is left in a partial/corrupted state and the next run re-transfers from scratch.
**Proposed changes:**
- CLI flags: `--partial`, `--partial-dir=<dir>`, `--inplace`
- Config fields: `bool use_partial`, `char* partial_dir`, `bool use_inplace`
- Protocol: no wire changes required; purely receiver-side write strategy
- Implementation:
- Default: write to `<dest>.fastsync.tmp` and `rename()` to final name on success
- `--partial`: leave temp file on failure and resume if size matches on next incremental run
- `--partial-dir`: write to `<partial-dir>/<relative-path>.fastsync.tmp`
- `--inplace`: open existing file for write and overwrite blocks as they arrive (more complex; lower priority)
**Priority:** high
**Rationale:** Resilience over unreliable networks is a core rsync use case. Without partial resume, large-file transfers over WAN are risky.
**Acceptance criteria:**
- [ ] Interrupting a large-file transfer leaves a resumable partial file when `--partial` is used
- [ ] Next invocation resumes from the partial file size when `--incremental` + `--partial` are combined
- [ ] `--partial-dir` isolates temp files from the destination tree
- [ ] Integration tests cover interruption and resume scenarios
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Corresponding rsync flags/behavior:
--partial— keep partially transferred files on interruption and resume on next run--partial-dir=DIR— store partial files in a hidden directory instead of alongside destination files--inplace— update destination files in place instead of writing to a temporary file and renamingCurrent FastSync behavior:
file_save_to_disk()insrc/shared/file.c:129opens the destination withfopen(path, "wb")and writes directly to the final path. If the transfer is interrupted, the destination is left in a partial/corrupted state and the next run re-transfers from scratch.Proposed changes:
--partial,--partial-dir=<dir>,--inplacebool use_partial,char* partial_dir,bool use_inplace<dest>.fastsync.tmpandrename()to final name on success--partial: leave temp file on failure and resume if size matches on next incremental run--partial-dir: write to<partial-dir>/<relative-path>.fastsync.tmp--inplace: open existing file for write and overwrite blocks as they arrive (more complex; lower priority)Priority: high
Rationale: Resilience over unreliable networks is a core rsync use case. Without partial resume, large-file transfers over WAN are risky.
Acceptance criteria:
--partialis used--incremental+--partialare combined--partial-dirisolates temp files from the destination tree