From 1cb4fe5a0ad896ede5680b261b5ad00920026a0d Mon Sep 17 00:00:00 2001 From: Larpon Date: Wed, 20 Apr 2022 14:29:58 +0200 Subject: [PATCH] os: add info about overwritten content to `write_file` (#14109) --- vlib/os/os.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/os/os.v b/vlib/os/os.v index 8940aecb5d..40d03658af 100644 --- a/vlib/os/os.v +++ b/vlib/os/os.v @@ -367,7 +367,8 @@ pub fn expand_tilde_to_home(path string) string { return path } -// write_file writes `text` data to a file in `path`. +// write_file writes `text` data to the file in `path`. +// If `path` exists already, the contents of `path` will be overwritten with the contents of `text`. pub fn write_file(path string, text string) ? { mut f := create(path) ? unsafe { f.write_full_buffer(text.str, usize(text.len)) ? }