mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-05 02:04:06 +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:
@@ -185,7 +185,9 @@ write_entire_file_or_err :: proc(name: string, data: []byte, truncate := true) -
|
||||
fd := open(name, flags, mode) or_return
|
||||
defer close(fd)
|
||||
|
||||
_ = write(fd, data) or_return
|
||||
for n := 0; n < len(data); {
|
||||
n += write(fd, data[n:]) or_return
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user