920 Commits

Author SHA1 Message Date
juaum
d06572c831 core/os: Add dir procedure 2026-04-04 10:13:19 +02:00
imp0s5ible
0d8fe07388 Fix array-bounds-exceeded error
We didn't consider empty base/target strings and accessed the ith
element unconditionally. We now check to make sure `i` is in range.
2026-03-29 21:24:57 +02:00
imp0s5ible
1f2d978396 Fix #6495 - Handle starting separator during name comparison
During the loop comparing file/directory names, the starting character
in both will be a path separator in most cases.
Since a naive string equality will regard forward slashes and
backslashes as different, we must specially handle the first character
and exclude it from the equality comparison if necessary.
2026-03-29 21:11:22 +02:00
pawelt
911f00521c Handle OOM error in path_linux / _get_working_directory() 2026-03-17 14:37:22 +01:00
gingerBill
20dcc8fd80 Remove use of @(init) for checking if Windows has long path support and check on first usage instead 2026-03-15 19:09:45 +00:00
IllusionMan1212
afbb0b4357 os: return .Permission_Denied for .EACCES in posix and linux 2026-03-03 17:50:31 +02:00
gingerBill
aea6274a10 Fix _mkdir_all for wasi 2026-02-19 14:54:34 +00:00
gingerBill
b643b0b1a9 Fix _copy_directory_all_native 2026-02-19 14:05:49 +00:00
gingerBill
cf3ac07a7e Fix copy_directory_all 2026-02-19 14:00:38 +00:00
gingerBill
26a4b2bfef Fix perm: int to perm: Permissions 2026-02-19 13:58:02 +00:00
Laytan Laats
7a7d7560b6 os: remove sys/unix dep on Linux 2026-02-18 20:16:55 +01:00
Laytan Laats
e87e3fba1b os: remove process_close and add process_terminate
`process_wait` (optionally prefaced with a `process_kill`) can be used
to properly close and free resources of the process.

`process_terminate` was added because `process_kill` is a forceful
exit, we were missing a way to request the process to terminate.
2026-02-18 20:15:07 +01:00
gingerBill
442b163871 Fix typos 2026-02-17 14:41:09 +00:00
gingerBill
966b76c4cb Add write_slice/read_slice utility procedures to core:bytes, core:io, and core:os 2026-02-17 14:34:28 +00:00
Jeroen van Rijn
95c82e0f76 Fix #6279
If the replacement rune was multi-byte, `os.replace_path_separators` would silently fail to replace anything.

Now it properly handles non-ASCII separator. Additionally added a fast path for when all runes in the input path as well as the replacement separator are simple ASCII.

Test added.
2026-02-15 12:42:55 +01:00
Jeroen van Rijn
d26ad6a0e5 Update doc line for core:os and core:os/old. 2026-02-14 00:55:21 +01:00
Jeroen van Rijn
faca11d593 Fix os.stem, os.short_stem. 2026-02-13 12:36:15 +01:00
Jeroen van Rijn
62cfa9e8e3 Narrowly tailor panic. 2026-02-12 12:21:01 +01:00
Jeroen van Rijn
658e6b9d9f Add core:log support for js/wasm
Also add #panic when importing `core:os` on wasm.
2026-02-12 12:12:21 +01:00
Jeroen van Rijn
97683ae014 Simplify 2026-02-12 10:48:26 +01:00
Jeroen van Rijn
8468d269dc Remove @(require_results) from os.read_directory_iterator 2026-02-11 19:15:32 +01:00
Jeroen van Rijn
1a37f4eb0c Only count bits in touched array members. 2026-02-09 19:13:32 +01:00
Jeroen van Rijn
454ad1f4b8 Unwrap cpu affinity syscalls. 2026-02-09 19:01:43 +01:00
Jeroen van Rijn
fa44c64c42 != nil 2026-02-09 18:29:31 +01:00
Jeroen van Rijn
ec05bb57dc Implement get_processor_core_count without libc for Linux. 2026-02-09 18:16:16 +01:00
Jeroen van Rijn
7a7127aa13 Fix package line 2026-02-09 16:34:24 +01:00
Jeroen van Rijn
8366e7094a Fix up ABI name for core:os and core:os/old 2026-02-09 16:27:53 +01:00
Jeroen van Rijn
e7dbabf668 core:os -> core:os/old && core:os/os2 -> core:os 2026-02-09 15:50:21 +01:00
Jeroen van Rijn
5bf30b2d56 Fix os2 file_wasi 2026-02-08 14:13:20 +01:00
Jeroen van Rijn
6270b02b2c Remove os2 mockup warning 2026-02-08 13:07:41 +01:00
Jeroen van Rijn
2e970db51d Link some more of filepath to os2 2026-02-08 12:56:05 +01:00
Jeroen van Rijn
0c341123cb More conflicts during rebase 2026-02-08 12:56:00 +01:00
Jeroen van Rijn
5924fb448e Add tests for glob + match 2026-02-08 12:54:25 +01:00
Jeroen van Rijn
1c9e36b05e Fix js_wasm 2026-02-08 12:54:23 +01:00
Jeroen van Rijn
691dc44719 Add glob + match to os2 2026-02-08 12:51:29 +01:00
Jeroen van Rijn
cc50be1a6c Add more filepath to os2 2026-02-08 12:51:29 +01:00
Jeroen van Rijn
ab0f1aa0c4 BSDs 2026-02-08 12:44:10 +01:00
Jeroen van Rijn
14021f6444 core:testing Darwin 2026-02-08 12:44:09 +01:00
Jeroen van Rijn
47786deddc In the middle of porting core:testing 2026-02-08 12:44:08 +01:00
Jeroen van Rijn
e094de5874 Add loc := #caller_location to read_entire_file 2026-02-08 12:44:05 +01:00
Jeroen van Rijn
a86ec95944 Address wasi errors 2026-02-08 12:42:29 +01:00
Jeroen van Rijn
304f22c8af core:os -> core:os/os for CSV, INI, and XML
Also had to vendor `core:encoding/ini` into `core:os/os2` for the user directories on *nix,
as it used that package to read `~/.config/user-dirs.dirs`, causing an import cycle.
2026-02-08 12:42:24 +01:00
Jeroen van Rijn
3303d3c98f Stub out core:os/os2 for js_wasm 2026-02-08 12:42:23 +01:00
Oleksandr Kovalenko
8d8aaf65aa os\os2 windows: fix truncate-clamp op order when determining to_read size 2026-01-31 15:01:56 +02:00
David Bader
fb9377df17 core/os: fix lookup_env_buf only working with empty buffer 2026-01-30 14:44:38 +01:00
gingerBill
16881e256d Fix absolute and volume name checks on Windows 2026-01-28 15:24:21 +00:00
Laytan Laats
bc70402093 os: add non blocking open flag 2026-01-11 20:21:25 +01:00
laytan
67177db0a8 os/os2: use ReadFile for Console reads too, at least for now 2025-12-20 20:09:19 +01:00
laytan
45a3cfa245 os/os2: better fix for the stale errors 2025-12-20 19:45:45 +01:00
laytan
ca1bb09e97 os/os2: fix stale errors on windows when reading from console 2025-12-20 18:31:48 +01:00