open_rawresource(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

🌸 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 πŸŽ€

  1. If the resource exists, it will be opened in a read-only mode.
  2. If the resource doesn't exist, it will be created and opened for writing (in appl, shared resources are read-only).
  3. 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 πŸ‘€


Signed, sealed, slayed: this page's source/version is resource, dated October 2026 πŸ«ΆπŸ’–

πŸ“¦ where this page comes from