mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Merge pull request #4059 from laytan/loop-write-entire-file
loop write_entire_file to write more than MAX_RW
This commit is contained in:
+3
-1
@@ -185,7 +185,9 @@ write_entire_file_or_err :: proc(name: string, data: []byte, truncate := true) -
|
|||||||
fd := open(name, flags, mode) or_return
|
fd := open(name, flags, mode) or_return
|
||||||
defer close(fd)
|
defer close(fd)
|
||||||
|
|
||||||
_ = write(fd, data) or_return
|
for n := 0; n < len(data); {
|
||||||
|
n += write(fd, data[n:]) or_return
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user