Add explicit append and truncate reopen helpers

This commit is contained in:
Nanaloveyuki
2026-05-10 12:55:02 +08:00
parent c779befc23
commit 1a9dfe2397
8 changed files with 62 additions and 19 deletions
+8
View File
@@ -201,6 +201,14 @@ pub fn FileSink::reopen_with_current_policy(self : FileSink) -> Bool {
self.reopen()
}
pub fn FileSink::reopen_append(self : FileSink) -> Bool {
self.reopen(append=Some(true))
}
pub fn FileSink::reopen_truncate(self : FileSink) -> Bool {
self.reopen(append=Some(false))
}
fn rotated_file_path(path : String, index : Int) -> String {
"\{path}.\{index}"
}