os: add info about overwritten content to `write_file` (#14109)
parent
5ec0820332
commit
1cb4fe5a0a
|
@ -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)) ? }
|
||||
|
|
Loading…
Reference in New Issue