From 70500a6aace73db61331bbeb28d8a215ec9a2280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Mangano?= Date: Sun, 28 May 2023 12:56:06 +0900 Subject: [PATCH] Close the input file before writing the final output --- src/cli.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cli.cc b/src/cli.cc index 59bc226..7ba41f8 100644 --- a/src/cli.cc +++ b/src/cli.cc @@ -613,6 +613,10 @@ static void run_single(const ot::options& opt, const std::string& path_in, const ot::ogg_writer writer(output); writer.path = path_out; process(reader, &writer, opt); + + // Close the input file and finalize the output. When --in-place is specified, some file + // systems like SMB require that the input is closed first. + input.reset(); temporary_output.commit(); }