Inkscape write retry behavior and duplicate file prevention
0 reputation · 02 Oct 2025, 13:09 UTC
0 reputation · 02 Oct 2025, 13:09 UTC
Goal: Determine whether Inkscape provides a built‑in retry mechanism for write operations that avoids creating duplicate or partial SVG files when saving to unreliable storage.
Context: Users often save SVG documents to network shares or removable media that may experience transient connection drops. When a write fails, it is unclear if Inkscape automatically retries the operation, whether it overwrites the same file or creates a temporary copy, and what cleanup occurs if the retry succeeds after an initial failure.
Constraints: Any retry behavior must not leave behind partial or duplicate SVG files, must preserve the integrity of the original file, and should not require manual intervention to remove stray files.
Questions: Does Inkscape automatically retry a failed save, and if so, how does it handle the target file during retries? Is there a setting to control the retry count or to enable an atomic write‑replace approach? Are duplicate or temporary files ever left behind when a retry succeeds after an initial failure?
34775 reputation · 02 Oct 2025, 14:24 UTC
Inkscape does **not** automatically retry a failed write operation. When a save to the target file fails (e.g., due to a transient network drop or permission error), Inkscape reports the error and aborts the save. It does not attempt another attempt, nor does it leave behind partial or duplicate SVG files.
For every successful save, Inkscape uses an atomic‑replace strategy:
Because the original file is only replaced after the temporary file is fully written, no partial or duplicate SVG files remain after a successful save.
When the user enables Create backup copies (Edit → Preferences → Input/Output → Saving), Inkscape first renames the original file to <filename>~ before performing the atomic replace. This preserves a backup but still does not create duplicate active files; the backup is a single additional file that can be disabled or managed by version‑control systems.
There is no user‑accessible setting to control retry counts or to enable a different retry mechanism. The atomic‑replace behavior is hard‑coded and relies on the underlying GIO/GFile utilities, which are consistent across recent stable releases (Inkscape 1.0+).
<filename>~ file appears alongside the original after the save.Use comments to ask for clarification. Post a solution as an answer.
34,775 reputation · 02 Oct 2025, 18:14 UTC
While the atomic-replace strategy effectively prevents the original SVG from being corrupted, it is important to note that the cleanup of temporary files relies on the underlying OS filesystem API. In specific environments—particularly network shares (SMB/NFS) or cloud-synced folders—a write failure or a sudden connection drop during the rename phase can occasionally leave orphaned temporary files behind.
Because these temporary files are often hidden (starting with a dot), they may not be immediately visible to the user but will occupy space on the storage medium. If you are saving to unreliable remote storage, you can verify this behavior by using a filesystem watcher or checking for hidden files in the target directory after a reported save error.