Repository navigation
Reliability and Safety
This guide explains how ia-get stages files, resumes downloads, checks disk space, protects local paths, and reports batch outcomes.
ia-get writes every download into a <file>.part staging file first.
When archive.org provides an MD5 hash, ia-get verifies the completed .part file and renames it to the final path atomically only after verification succeeds.
When a destination file already exists on disk and archive metadata provides an expected size, ia-get compares the local size first.
If the sizes differ, ia-get skips MD5 hashing and re-downloads the file immediately.
When a .part file already exists, ia-get sends an HTTP Range request and validates HTTP 200, 206, and 416 responses plus the Content-Range header:
-
HTTP
206with validContent-Range: appends the remaining bytes to the.partfile. -
HTTP
200or invalid range response: discards the partial transfer and restarts the download from byte 0. -
HTTP
416(Range Not Satisfiable): checks the complete remote length fromContent-Range. If the.partfile matches the full length and passes MD5 verification,ia-getpromotes it to the final path. If the.partfile is oversized, or has the expected length but fails verification (a corrupt equal-length.partfile),ia-getdiscards it and restarts an unranged download from byte 0.
Before any file transfer starts, ia-get checks free space on the destination volume against the remaining known bytes of the selected files.
- Verified final files already on disk and resumable
.partprefixes are deducted from the required byte count. - Entries with unknown sizes in archive metadata are ignored by this calculation.
- When free space is insufficient,
ia-getstops before issuing any file request and prints an error showing the required and available space. -
--listand--checkskip this check.
Every download stays inside the target output directory (the current working directory by default).
-
ia-getrejects paths that resolve outside the destination root. -
ia-getrefuses symlinks and non-regular files such as directories or named pipes (FIFOs). On Unix platforms, file opens useO_NOFOLLOW. - For cross-platform safety,
ia-getsanitises invalid filename characters, dot segments (.and..), and trailing spaces or dots in path components. -
ia-getrenames Windows reserved device names:CON,PRN,AUX,NUL,CONIN$,CONOUT$,CLOCK$,COM0-COM9,COM¹-COM³,LPT0-LPT9, andLPT¹-LPT³. This check ignores case and matches reserved names with or without extensions, even when trailing spaces or dots appear before an extension.
Before creating directories or transferring files, ia-get checks all planned entries for local path collisions.
ia-get rejects a run if any two entries create:
- Duplicate sanitised destination paths
-
.partstaging collisions, where a.partpath collides with another entry's final destination path or.partpath - File-versus-directory conflicts, where one entry's file path matches another entry's parent directory path
To catch host-specific collisions accurately, ia-get probes existing non-symlink parent directories for real filesystem case-folding and Unicode normalisation lookup rules.
When creating a temporary probe subdirectory is unavailable, ia-get falls back to prefixed temporary probe files directly inside that directory, and removes all probe artefacts afterwards.
If distinctness cannot be proved on the destination filesystem, validation fails closed so ia-get never silently overwrites another file.
When a file fails to download or fails MD5 verification, ia-get prints a warning and continues with the remaining files.
At the end of a run, ia-get prints a summary with ok, skipped, and failed counts and lists any failed files in original XML metadata order.
ia-get exits with status 0 only when all selected files succeed without interruption.
If any file fails or Ctrl+C interrupts the run, ia-get exits with a non-zero status.
Edit this documentation in the repository's wiki/ directory.