package core:os

⌘K
Ctrl+K
or
/

    Index

    Constants (55)
    Variables (4)
    Procedures (72)

    Types

    Errno ¶

    Errno :: Error
     

    alias for legacy use

    Related Constants

    File_Info ¶

    File_Info :: struct {
    	fullpath:          string,
    	// allocated
    	name:              string,
    	// uses `fullpath` as underlying data
    	size:              i64,
    	mode:              File_Mode,
    	is_dir:            bool,
    	creation_time:     time.Time,
    	modification_time: time.Time,
    	access_time:       time.Time,
    }
    Related Procedures With Parameters
    Related Procedures With Returns

    File_Time ¶

    File_Time :: distinct u64
    Related Procedures With Returns

    General_Error ¶

    General_Error :: enum u32 {
    	None, 
    	Permission_Denied, 
    	Exist, 
    	Not_Exist, 
    	Closed, 
    	Timeout, 
    	Broken_Pipe, 
    	// Indicates that an attempt to retrieve a file's size was made, but the
    	// file doesn't have a size.
    	No_Size, 
    	Invalid_File, 
    	Invalid_Dir, 
    	Invalid_Path, 
    	Invalid_Callback, 
    	Pattern_Has_Separator, 
    	Unsupported, 
    	File_Is_Pipe, 
    	Not_Dir, 
    }
    Related Constants

    Constants

    ARCH ¶

    ARCH: .Odin_Arch_Type : ODIN_ARCH

    ENDIAN ¶

    ENDIAN: .Odin_Endian_Type : ODIN_ENDIAN

    ERROR_ACCESS_DENIED ¶

    ERROR_ACCESS_DENIED: sys_windows.System_Error : _Platform_Error(5)

    ERROR_ALREADY_EXISTS ¶

    ERROR_ALREADY_EXISTS: sys_windows.System_Error : _Platform_Error(183)

    ERROR_BROKEN_PIPE ¶

    ERROR_BROKEN_PIPE: sys_windows.System_Error : _Platform_Error(109)

    ERROR_BUFFER_OVERFLOW ¶

    ERROR_BUFFER_OVERFLOW: sys_windows.System_Error : _Platform_Error(111)

    ERROR_DIR_NOT_EMPTY ¶

    ERROR_DIR_NOT_EMPTY: sys_windows.System_Error : _Platform_Error(145)

    ERROR_ENVVAR_NOT_FOUND ¶

    ERROR_ENVVAR_NOT_FOUND: sys_windows.System_Error : _Platform_Error(203)

    ERROR_EOF ¶

    ERROR_EOF: io.Error : io.Error.EOF

    ERROR_FILE_EXISTS ¶

    ERROR_FILE_EXISTS: sys_windows.System_Error : _Platform_Error(80)

    ERROR_FILE_IS_NOT_DIR ¶

    ERROR_FILE_IS_NOT_DIR :: General_Error.Not_Dir

    ERROR_FILE_IS_PIPE ¶

    ERROR_FILE_IS_PIPE :: General_Error.File_Is_Pipe

    ERROR_FILE_NOT_FOUND ¶

    ERROR_FILE_NOT_FOUND: sys_windows.System_Error : _Platform_Error(2)

    ERROR_HANDLE_EOF ¶

    ERROR_HANDLE_EOF: sys_windows.System_Error : _Platform_Error(38)

    ERROR_INSUFFICIENT_BUFFER ¶

    ERROR_INSUFFICIENT_BUFFER: sys_windows.System_Error : _Platform_Error(122)

    ERROR_INVALID_HANDLE ¶

    ERROR_INVALID_HANDLE: sys_windows.System_Error : _Platform_Error(6)

    ERROR_INVALID_PARAMETER ¶

    ERROR_INVALID_PARAMETER: sys_windows.System_Error : _Platform_Error(87)

    ERROR_IO_PENDING ¶

    ERROR_IO_PENDING: sys_windows.System_Error : _Platform_Error(997)

    ERROR_MOD_NOT_FOUND ¶

    ERROR_MOD_NOT_FOUND: sys_windows.System_Error : _Platform_Error(126)

    ERROR_MORE_DATA ¶

    ERROR_MORE_DATA: sys_windows.System_Error : _Platform_Error(234)

    ERROR_NEGATIVE_SEEK ¶

    ERROR_NEGATIVE_SEEK: sys_windows.System_Error : _Platform_Error(131)

    ERROR_NETNAME_DELETED ¶

    ERROR_NETNAME_DELETED: sys_windows.System_Error : _Platform_Error(64)

    ERROR_NONE ¶

    ERROR_NONE :: Error{}

    ERROR_NOT_ENOUGH_MEMORY ¶

    ERROR_NOT_ENOUGH_MEMORY: sys_windows.System_Error : _Platform_Error(8)

    ERROR_NOT_FOUND ¶

    ERROR_NOT_FOUND: sys_windows.System_Error : _Platform_Error(1168)

    ERROR_NO_MORE_FILES ¶

    ERROR_NO_MORE_FILES: sys_windows.System_Error : _Platform_Error(18)

    ERROR_OPERATION_ABORTED ¶

    ERROR_OPERATION_ABORTED: sys_windows.System_Error : _Platform_Error(995)

    ERROR_PATH_NOT_FOUND ¶

    ERROR_PATH_NOT_FOUND: sys_windows.System_Error : _Platform_Error(3)

    ERROR_PRIVILEGE_NOT_HELD ¶

    ERROR_PRIVILEGE_NOT_HELD: sys_windows.System_Error : _Platform_Error(1314)

    ERROR_PROC_NOT_FOUND ¶

    ERROR_PROC_NOT_FOUND: sys_windows.System_Error : _Platform_Error(127)

    File_Mode_Char_Device ¶

    File_Mode_Char_Device :: File_Mode(1 << 19)

    File_Mode_Device ¶

    File_Mode_Device :: File_Mode(1 << 18)

    File_Mode_Dir ¶

    File_Mode_Dir :: File_Mode(1 << 16)

    File_Mode_Named_Pipe ¶

    File_Mode_Named_Pipe :: File_Mode(1 << 17)
    File_Mode_Sym_Link :: File_Mode(1 << 20)

    INVALID_HANDLE ¶

    INVALID_HANDLE: Handle : ~Handle(0)

    OS ¶

    OS: .Odin_OS_Type : ODIN_OS

    O_APPEND ¶

    O_APPEND :: 0x00400

    O_ASYNC ¶

    O_ASYNC :: 0x02000

    O_CLOEXEC ¶

    O_CLOEXEC :: 0x80000

    O_CREATE ¶

    O_CREATE :: 0x00040

    O_EXCL ¶

    O_EXCL :: 0x00080

    O_NOCTTY ¶

    O_NOCTTY :: 0x00100

    O_NONBLOCK ¶

    O_NONBLOCK :: 0x00800

    O_RDONLY ¶

    O_RDONLY :: 0x00000

    O_RDWR ¶

    O_RDWR :: 0x00002

    O_SYNC ¶

    O_SYNC :: 0x01000

    O_TRUNC ¶

    O_TRUNC :: 0x00200

    O_WRONLY ¶

    O_WRONLY :: 0x00001

    SEEK_CUR ¶

    SEEK_CUR :: 1

    SEEK_END ¶

    SEEK_END :: 2

    SEEK_SET ¶

    SEEK_SET :: 0

    WINDOWS_11_BUILD_CUTOFF ¶

    WINDOWS_11_BUILD_CUTOFF :: 22_000
     
    Windows 11 (preview) has the same major and minor version numbers
    as Windows 10: 10 and 0 respectively.
    
    To determine if you're on Windows 10 or 11, we need to look at
    the build number. As far as we can tell right now, the cutoff is build 22_000.
    
    TODO: Narrow down this range once Win 11 is published and the last Win 10 builds
    

    become available.

    WSAEACCES ¶

    WSAEACCES: sys_windows.System_Error : _Platform_Error(10013)

    WSAECONNRESET ¶

    WSAECONNRESET: sys_windows.System_Error : _Platform_Error(10054)

    Variables

    args ¶

    args: []string = …
     

    "Argv" arguments converted to Odin strings

    stderr ¶

    stderr: Handle = …

    stdin ¶

    stdin: Handle = …
     

    NOTE(bill): Uses startup to initialize it

    stdout ¶

    stdout: Handle = …

    Procedures

    clear_env ¶

    clear_env :: proc() {…}
     

    clear_env deletes all environment variables

    close ¶

    close :: proc(fd: Handle) -> Error {…}

    current_thread_id ¶

    current_thread_id :: proc "contextless" () -> int {…}

    environ ¶

    environ :: proc(allocator := context.allocator) -> []string {…}
     

    environ returns a copy of strings representing the environment, in the form "key=value" NOTE: the slice of strings and the strings with be allocated using the supplied allocator

    error_string ¶

    error_string :: proc "contextless" (ferr: Error) -> string {…}

    exists ¶

    exists :: proc(path: string) -> bool {…}

    exit ¶

    exit :: proc "contextless" (code: int) -> ! {…}

    file_info_delete ¶

    file_info_delete :: proc(fi: File_Info, allocator := context.allocator) {…}

    file_info_slice_delete ¶

    file_info_slice_delete :: proc(infos: []File_Info, allocator := context.allocator) {…}

    file_size ¶

    file_size :: proc(fd: Handle) -> (i64, Error) {…}

    file_size_from_path ¶

    file_size_from_path :: proc(path: string) -> i64 {…}

    flush ¶

    flush :: proc(fd: Handle) -> (err: Error) {…}

    fstat ¶

    fstat :: proc(fd: Handle, allocator := context.allocator) -> (fi: File_Info, err: Error) {…}

    ftruncate ¶

    ftruncate :: proc(fd: Handle, length: i64) -> (err: Error) {…}

    get_current_directory ¶

    get_current_directory :: proc(allocator := context.allocator) -> string {…}

    get_env ¶

    get_env :: proc(key: string, allocator := context.allocator) -> (value: string) {…}
     

    get_env retrieves the value of the environment variable named by the key It returns the value, which will be empty if the variable is not present To distinguish between an empty value and an unset value, use lookup_env NOTE: the value will be allocated with the supplied allocator

    get_last_error ¶

    get_last_error :: proc "contextless" () -> Error {…}

    get_page_size ¶

    get_page_size :: proc() -> int {…}

    get_std_handle ¶

    get_std_handle :: proc "contextless" (h: uint) -> Handle {…}

    get_windows_version_w ¶

    get_windows_version_w :: proc "contextless" () -> sys_windows.OSVERSIONINFOEXW {…}

    is_dir ¶

    is_dir :: proc(path: string) -> bool {…}

    is_file ¶

    is_file :: proc(path: string) -> bool {…}

    is_path_separator ¶

    is_path_separator :: proc(c: u8) -> bool {…}

    is_platform_error ¶

    is_platform_error :: proc "contextless" (ferr: Error) -> (err: i32, ok: bool) {…}

    is_windows_10 ¶

    is_windows_10 :: proc "contextless" () -> bool {…}

    is_windows_11 ¶

    is_windows_11 :: proc "contextless" () -> bool {…}

    is_windows_7 ¶

    is_windows_7 :: proc "contextless" () -> bool {…}

    is_windows_8 ¶

    is_windows_8 :: proc "contextless" () -> bool {…}

    is_windows_8_1 ¶

    is_windows_8_1 :: proc "contextless" () -> bool {…}

    is_windows_vista ¶

    is_windows_vista :: proc "contextless" () -> bool {…}

    is_windows_xp ¶

    is_windows_xp :: proc "contextless" () -> bool {…}

    last_write_time ¶

    last_write_time :: proc(fd: Handle) -> (File_Time, Error) {…}

    last_write_time_by_name ¶

    last_write_time_by_name :: proc(name: string) -> (File_Time, Error) {…}
    link :: proc(old_name, new_name: string) -> (err: Error) {…}

    lookup_env ¶

    lookup_env :: proc(key: string, allocator := context.allocator) -> (value: string, found: bool) {…}
     

    lookup_env gets the value of the environment variable named by the key If the variable is found in the environment the value (which can be empty) is returned and the boolean is true Otherwise the returned value will be empty and the boolean will be false NOTE: the value will be allocated with the supplied allocator

    lstat ¶

    lstat :: proc(name: string, allocator := context.allocator) -> (File_Info, Error) {…}

    make_directory ¶

    make_directory :: proc(path: string, mode: u32 = 0) -> (err: Error) {…}

    open ¶

    open :: proc(path: string, mode: int = O_RDONLY, perm: int = 0) -> (Handle, Error) {…}

    pipe ¶

    pipe :: proc() -> (r, w: Handle, err: Error) {…}
    print_error :: proc(f: Handle, ferr: Error, msg: string) -> (n: int, err: Error) {…}

    processor_core_count ¶

    processor_core_count :: proc() -> int {…}

    read ¶

    read :: proc(fd: Handle, data: []u8) -> (total_read: int, err: Error) {…}

    read_at ¶

    read_at :: proc(fd: Handle, data: []u8, offset: i64) -> (n: int, err: Error) {…}
     

    read_at returns n: 0, err: 0 on EOF

    read_at_least ¶

    read_at_least :: proc(fd: Handle, buf: []u8, min: int) -> (n: int, err: Error) {…}

    read_dir ¶

    read_dir :: proc(fd: Handle, n: int, allocator := context.allocator) -> (fi: []File_Info, err: Error) {…}

    read_entire_file_from_filename ¶

    read_entire_file_from_filename :: proc(name: string, allocator := context.allocator, loc := #caller_location) -> (data: []u8, success: bool) {…}

    read_entire_file_from_filename_or_err ¶

    read_entire_file_from_filename_or_err :: proc(name: string, allocator := context.allocator, loc := #caller_location) -> (data: []u8, err: Error) {…}

    read_entire_file_from_handle ¶

    read_entire_file_from_handle :: proc(fd: Handle, allocator := context.allocator, loc := #caller_location) -> (data: []u8, success: bool) {…}

    read_entire_file_from_handle_or_err ¶

    read_entire_file_from_handle_or_err :: proc(fd: Handle, allocator := context.allocator, loc := #caller_location) -> (data: []u8, err: Error) {…}

    read_full ¶

    read_full :: proc(fd: Handle, buf: []u8) -> (n: int, err: Error) {…}

    read_ptr ¶

    read_ptr :: proc(fd: Handle, data: rawptr, len: int) -> (int, Error) {…}

    remove ¶

    remove :: proc(name: string) -> Error {…}

    remove_directory ¶

    remove_directory :: proc(path: string) -> (err: Error) {…}

    rename ¶

    rename :: proc(old_path, new_path: string) -> (err: Error) {…}

    seek ¶

    seek :: proc(fd: Handle, offset: i64, whence: int) -> (i64, Error) {…}

    set_current_directory ¶

    set_current_directory :: proc(path: string) -> (err: Error) {…}

    set_env ¶

    set_env :: proc(key, value: string) -> Error {…}
     

    set_env sets the value of the environment variable named by the key

    stat ¶

    stat :: proc(name: string, allocator := context.allocator) -> (File_Info, Error) {…}

    stream_from_handle ¶

    stream_from_handle :: proc(fd: Handle) -> io.Stream {…}

    truncate ¶

    truncate :: proc(path: string, length: i64) -> (err: Error) {…}
    unlink :: proc(path: string) -> (err: Error) {…}

    unset_env ¶

    unset_env :: proc(key: string) -> Error {…}
     

    unset_env unsets a single environment variable

    write ¶

    write :: proc(fd: Handle, data: []u8) -> (int, Error) {…}

    write_at ¶

    write_at :: proc(fd: Handle, data: []u8, offset: i64) -> (n: int, err: Error) {…}

    write_byte ¶

    write_byte :: proc(fd: Handle, b: u8) -> (int, Error) {…}

    write_encoded_rune ¶

    write_encoded_rune :: proc(f: Handle, r: rune) -> (n: int, err: Error) {…}

    write_entire_file ¶

    write_entire_file :: proc(name: string, data: []u8, truncate: bool = true) -> (success: bool) {…}

    write_entire_file_or_err ¶

    write_entire_file_or_err :: proc(name: string, data: []u8, truncate: bool = true) -> Error {…}

    write_ptr ¶

    write_ptr :: proc(fd: Handle, data: rawptr, len: int) -> (int, Error) {…}

    write_rune ¶

    write_rune :: proc(fd: Handle, r: rune) -> (int, Error) {…}

    write_string ¶

    write_string :: proc(fd: Handle, str: string) -> (int, Error) {…}

    Procedure Groups

    Source Files

    Generation Information

    Generated with odin version dev-2024-12 (vendor "odin") Windows_amd64 @ 2024-12-20 21:10:46.125878700 +0000 UTC