Skip to main content

partial_path

Function partial_path 

Source
pub fn partial_path(target: &Path) -> PathBuf
Expand description

The partial-download sidecar for target.

Appends .part rather than replacing the extension. The worker used Path::with_extension("part"), which replaces: movie.mp4 became movie.part. Every cleanup path meanwhile deleted "{file_path}.part"movie.mp4.part — so nothing ever matched and the partial file of every cancelled or failed download was left on disk forever, invisible to the disk-usage totals because no downloads row pointed at it. That is the reported “failure is not cleaned”.

Appending also removes a collision the old form had: movie.mp4 and movie.mkv both mapped to movie.part and would have fought over one file.

One function so the writer and the cleaners cannot disagree again.

TRACES: UR-055 | DR-169