open_rawresource(3)
πΈ open_rawresource(3) β Arcan Lua API πΈ
Hey bestie! Welcome to the open_rawresource(3) page from the Arcan Lua API β it's all about opening a private or shared resource for reading/writing, and we're gonna get into it π
β¨ NAME β¨
open_rawresource β Open a private or shared resource for reading/writing π
π¦ SYNOPSIS π¦
success_bool
open_rawresource( resstr )
π DESCRIPTION π
Okay so each session can have one globally opened and synchronously managed text file, and it's worked with in a rather limited fashion. It's primarily intended for debugging or quick temporary hacks β no cap. Typically, user/appl data should be stored in the database if at all possible, and binary data should only be in forms that the indirect functions can work with (like load_image etc.). Other I/O operations β e.g. named pipes β should go through the open_nonblock style functions.
π NOTES π
- If the resource exists, it will be opened in a read-only mode.
- If the resource doesn't exist, it will be created and opened for writing (in
appl, shared resources are read-only). - This function is blocking, and should only be used where possible I/O stalls is desired.
π EXAMPLE π
Here's a tiny example, bestie:
function open_rawresource0()
if (open_rawresource("test.txt")) then
print("resource opened");
else
print("couldn't open resource");
end
end
π MISUSE π
Do not do this one, fr fr β it's giving "danger will robinson!" for a reason:
function open_rawresource0()
if (open_rawresource("../../../../../../../etc/passwd")) then
print("danger will robinson!");
end
end
π SEE ALSO π
close_rawresource(3)read_rawresource(3)zap_rawresource(3)open_nonblock(3)
Signed, sealed, slayed: this page's source/version is resource, dated October 2026 π«Άπ
π¦ where this page comes from
- nixos 26.05: arcan 0.7.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms