Document the rest of os2.

This commit is contained in:
gingerBill
2025-10-31 16:00:44 +00:00
parent d2e274f0fe
commit fc5ef57a97
3 changed files with 45 additions and 5 deletions
+13
View File
@@ -80,6 +80,19 @@ make_directory_temp :: proc(dir, pattern: string, allocator: runtime.Allocator)
}
temp_dir :: temp_directory
/*
Returns the default directory to use for temporary files.
On Unix systems, it typically returns $TMPDIR if non-empty, otherwlse `/tmp`.
On Windows, it uses `GetTempPathW`, returning the first non-empty value from one of the following:
* `%TMP%`
* `%TEMP%`
* `%USERPROFILE %`
* or the Windows directory
See https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettemppathw for more information.
On wasi, it returns `/tmp`.
*/
@(require_results)
temp_directory :: proc(allocator: runtime.Allocator) -> (string, Error) {
return _temp_dir(allocator)