mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:17:34 +00:00
Userland: Open files for save in write-only mode
WavWriter and the shot utility open files with this mode and never truncate the files, which might leave some contents of a previous file during overwriting.
This commit is contained in:
parent
fb305b66c2
commit
55b6e07a0f
2 changed files with 2 additions and 2 deletions
|
@ -33,7 +33,7 @@ WavWriter::~WavWriter()
|
|||
|
||||
ErrorOr<void> WavWriter::set_file(StringView path)
|
||||
{
|
||||
m_file = TRY(Core::File::open(path, Core::File::OpenMode::ReadWrite));
|
||||
m_file = TRY(Core::File::open(path, Core::File::OpenMode::Write));
|
||||
TRY(m_file->seek(44, SeekMode::SetPosition));
|
||||
m_finalized = false;
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue