core:os -> core:os/os for core:math/big

This commit is contained in:
Jeroen van Rijn
2025-10-28 02:07:03 +01:00
parent 94d6a85ddd
commit 4db4c49912

View File

@@ -15,9 +15,9 @@ package math_big
- Also look at extracting and splatting several digits at once.
*/
import "base:intrinsics"
import "core:mem"
import "core:os"
import "base:intrinsics"
import "core:mem"
import os "core:os/os2"
/*
This version of `itoa` allocates on behalf of the caller. The caller must free the string.
@@ -395,11 +395,10 @@ internal_int_read_from_ascii_file :: proc(a: ^Int, filename: string, radix := i8
For now, we'll read the entire file. Eventually we'll replace this with a copy that duplicates the logic
of `atoi` so we don't need to read the entire file.
*/
res, ok := os.read_entire_file(filename, allocator)
res, res_err := os.read_entire_file(filename, allocator)
defer delete(res, allocator)
if !ok {
if res_err != nil {
return .Cannot_Read_File
}
@@ -429,8 +428,8 @@ internal_int_write_to_ascii_file :: proc(a: ^Int, filename: string, radix := i8(
len = l,
}
ok := os.write_entire_file(filename, data, truncate=true)
return nil if ok else .Cannot_Write_File
write_err := os.write_entire_file(filename, data, truncate=true)
return nil if write_err == nil else .Cannot_Write_File
}
/*