Truncate files written with "-o".
This commit is contained in:
@@ -348,7 +348,7 @@ invocations in a single, long, pipeline.
|
||||
Write data to
|
||||
.I FILE
|
||||
rather than standard output. If the file already exists, it will be
|
||||
overwritten from the start, but not truncated.
|
||||
truncated.
|
||||
.TP
|
||||
.BI \-L\ RATE \fR,\ \fB\-\-rate-limit\ RATE
|
||||
Limit the transfer to a maximum of
|
||||
|
||||
+1
-2
@@ -260,8 +260,7 @@ that are explicitly switched on will be shown.
|
||||
**-o FILE, \--output FILE**
|
||||
|
||||
: Write data to *FILE* rather than standard output. If the file
|
||||
already exists, it will be overwritten from the start, but not
|
||||
truncated.
|
||||
already exists, it will be truncated.
|
||||
|
||||
**-L RATE, \--rate-limit RATE**
|
||||
|
||||
|
||||
+1
-1
@@ -306,7 +306,7 @@ int main(int argc, char **argv)
|
||||
if (NULL == opts->output || 0 == strcmp(opts->output, "-")) {
|
||||
pv_state_output_set(state, STDOUT_FILENO, "(stdout)");
|
||||
} else {
|
||||
int fd = open(opts->output, O_WRONLY | O_CREAT, 0600); /* flawfinder: ignore */
|
||||
int fd = open(opts->output, O_WRONLY | O_CREAT | O_TRUNC, 0600); /* flawfinder: ignore */
|
||||
/*
|
||||
* flawfinder rationale: the output filename has been
|
||||
* explicitly provided, and in many cases the operator will
|
||||
|
||||
Reference in New Issue
Block a user