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)