summaryrefslogtreecommitdiff
path: root/docs/cmdline-opts/remove-on-error.md
blob: ec7b88882b51c48904242e75a64add5208b9da21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Long: remove-on-error
Help: Remove output file on errors
Category: output
Added: 7.83.0
Multi: boolean
See-also:
  - fail
Example:
  - --remove-on-error -o output $URL
---

# `--remove-on-error`

Remove the output file if an error occurs. If curl returns an error when told to
save output in a local file. This prevents curl from leaving a partial file in
the case of an error during transfer.

If the output is not a regular file, this option has no effect.

The --continue-at option cannot be used together with --remove-on-error.