Opens a file stream using a vl_filesys_path object.
██ ██ ██ █████ ███████ █████ ██████ ███ ██ █████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ███████ ███████ ███████ ██ ███ ██ ██ ██ ███████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ███████ ██ ██ ███████ ██ ██ ██████ ██ ████ ██ ██ ====—: A Data Structure and Algorithms library for C11. :—====
Copyright 2026 Jesse Walker, released under the MIT license. Git Repository: https://github.com/walkerje/veritable_lasagna
Contract
- Ownership: The caller owns the returned
vl_stream pointer and is responsible for calling vlStreamDelete. The stream manages the internal FILE* and closes it on deletion.
- Lifetime: The stream is valid until its reference count reaches zero.
- Thread Safety: Thread-safe (the returned stream has an internal mutex).
- Nullability: Returns
NULL if path or mode is NULL, or if the file cannot be opened.
- Error Conditions: Returns
NULL if fopen (or platform equivalent) fails or if heap allocation fails.
- Undefined Behavior: None.
- Memory Allocation Expectations: Allocates memory for the
vl_stream struct, an internal context struct, and synchronization primitives.
- Return-value Semantics: Returns a pointer to the new stream, or
NULL if the file could not be opened.
- Parameters
-
| path | The path object containing the UTF-8 path. |
| mode | The standard C fopen mode string (e.g., "rb", "wb", "r+"). |
- Returns
- A new stream object, or NULL if the file could not be opened.