Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
open_rawresource(3)		 Arcan Lua API		   open_rawresource(3)

NAME
       open_rawresource	 - Open	a private or shared resource for reading/writ-
       ing

SYNOPSIS
       success_bool
       open_rawresource( resstr	)

DESCRIPTION
       Each session can	have one- globally opened  and	synchronously  managed
       text  file  for working with in a rather	limited	fashion, primarily in-
       tended for debugging or quick  temporary	 hacks.	 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  working
       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	possi-
	      ble I/O stalls is	desired.

EXAMPLE
       function	open_rawresource0()
	     if	(open_rawresource("test.txt")) then
		   print("resource opened");
	     else
		   print("couldn't open	resource");
	     end
       end

MISUSE
       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_non-
       block(3)

resource			  April	2025		   open_rawresource(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=open_rawresource&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>

home | help