GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
open_rawresource(3) Arcan Lua API open_rawresource(3)

open_rawresource - Open a private or shared resource for reading/writing

success_bool
open_rawresource( resstr )

Each session can have one- globally opened and synchronously managed text file for working with in a rather limited fashion, primarily intended 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.

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.

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

function open_rawresource0()
      if (open_rawresource("../../../../../../../etc/passwd")) then
            print("danger will robinson!");
      end
end

close_rawresource(3) read_rawresource(3) zap_rawresource(3) open_nonblock(3)

June 2022 resource

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.