From f5cf03d2f529675f8dedb3ade2b8690eece99066 Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Thu, 4 Oct 2018 09:22:04 +0100 Subject: [PATCH] A minor documentation update --- modules/juce_core/files/juce_File.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/juce_core/files/juce_File.h b/modules/juce_core/files/juce_File.h index a360f91355..9231399dbb 100644 --- a/modules/juce_core/files/juce_File.h +++ b/modules/juce_core/files/juce_File.h @@ -616,8 +616,13 @@ public: /** Creates a stream to write to this file. If the file exists, the stream that is returned will be positioned ready for - writing at the end of the file, so you might want to use deleteFile() first - to write to an empty file. + writing at the end of the file. If you want to write to the start of the file, + replacing the existing content, then you can do the following: + @code + auto* stream = file.createOutputStream(); + stream->setPosition (0); + stream->truncate(); + @endcode @returns a stream that will write to this file (initially positioned at the end of the file), or nullptr if the file can't be opened for some reason