Load at compile-time
-
#load .
-
Returns a
[]u8of the file contents at compile time. -
The loaded data is baked into your program.
-
You can provide a type name as a second argument; interpreting the data as being of that type.
-
-
-
Loads all files within a directory, at compile time.
-
The data is
name: stringanddata: []byte.
-
-
All the data of those files will be baked into your program.
-
-
-
Returns a constant integer of the hash of a fileβs contents at compile time.
-
Available hashes:
"adler32","crc32","crc64","fnv32","fnv64","fnv32a","fnv64a","murmur32", or"murmur64".
-
core:os2
-
core:os/os2 -
It will replace
core:osin 2026. -
(2025-07-07)
-
It's not on the web docs yet. Technically it's still WIP, though some parts of it are quite usable.
-
-
process_exec-
run with piped output and wait.
-
Process Execute
-
Must :
-
This procedure expects that
stdoutandstderrfields of thedescparameter are left at default, i.e. anilvalue. You can not capture stdout/stderr and redirect it to a file at the same time. -
assert(desc.stdout == nil, "Cannot redirect stdout when it's being captured", loc) -
assert(desc.stderr == nil, "Cannot redirect stderr when it's being captured", loc)
-
-
Memory :
-
This procedure does not free
stdoutandstderrslices before an error is returned. Make sure to calldeleteon these slices.
-
Process Start
-
process_start -
Asynchronous and more configurable, but requires more setup.
-
See Shells .
core:os
-
Handle.-
Used to perform many operations.
-
-
open. -
read.-
read_entire_file_from_filename.-
core/os/os.odin:131: Automatically doesopenand thenclose.
-
-
read_entire_file_from_handle.-
core/os/os.odin:141: Does not doopenorclose.
-
-
-
write. -
flush. -
close. -
exists. -
if_file. -
remove. -
rename.
core:c/libc
-
core:c/libc -
Not native in Odin.
-
Has
systemfor just running basic command-line commands -
(2025-10-29)
-
I was using
libc.systemfor some basic commands, but once I learned how to use theos2, I think is much better and should be the go to for CLI.