summaryrefslogtreecommitdiffstats
path: root/core/core_bind.h
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2020-12-15 15:31:04 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2021-02-13 01:37:16 +0100
commitab397460e9f8ea36414eb1b11d76c3e223decdcc (patch)
tree1d16317a797b0e179443691bb334e035d845fd11 /core/core_bind.h
parent45c6d3c5767f0ebc60ef1334aec5720680191eec (diff)
downloadredot-engine-ab397460e9f8ea36414eb1b11d76c3e223decdcc.tar.gz
Expose a `File.flush()` method to scripting
This can be used to ensure a file has its contents saved even if the project crashes or is killed by the user (among other use cases). See discussion in #29075.
Diffstat (limited to 'core/core_bind.h')
-rw-r--r--core/core_bind.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/core_bind.h b/core/core_bind.h
index 44e620085a..7f945a9314 100644
--- a/core/core_bind.h
+++ b/core/core_bind.h
@@ -386,6 +386,7 @@ public:
Error open_compressed(const String &p_path, ModeFlags p_mode_flags, CompressionMode p_compress_mode = COMPRESSION_FASTLZ);
Error open(const String &p_path, ModeFlags p_mode_flags); // open a file.
+ void flush(); // Flush a file (write its buffer to disk).
void close(); // Close a file.
bool is_open() const; // True when file is open.