We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07ee934 commit 6430347Copy full SHA for 6430347
3 files changed
vlib/os/os.v
@@ -566,13 +566,11 @@ pub fn expand_tilde_to_home(path string) string {
566
// write_file writes `text` data to a file with the given `path`.
567
// If `path` already exists, it will be overwritten.
568
pub fn write_file(path string, text string) ! {
569
- $if windows {
570
- mut f := create(path)!
571
- unsafe { f.write_full_buffer(text.str, usize(text.len))! }
+ mut f := create(path)!
+ defer {
572
f.close()
573
- } $else {
574
- write_file_direct(path, text)!
575
}
+ unsafe { f.write_full_buffer(text.str, usize(text.len))! }
576
577
578
pub struct ExecutableNotFoundError {
0 commit comments