File is deleted on write to ensure it does not continuously grow
This commit is contained in:
parent
86ae7ad4aa
commit
0a5d99cd6f
3 changed files with 7 additions and 1 deletions
|
@ -210,6 +210,8 @@ class ByteLayer {
|
|||
|
||||
Future<void> writeToFile(String filePath) async {
|
||||
final file = File(filePath);
|
||||
if (file.existsSync())
|
||||
file.deleteSync(); // Ensure we flush the file to 0 bytes
|
||||
await file.writeAsBytes(bytes);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue