../
kernel
functions
add
all
apply_delta
assert
atan2
btn
btnp
camera
cd
char
chooser
circ
circfill
clip
cls
color
cos
count
cp
create_delta
create_gui
create_process
cursor
date
del
deli
env
error
exit
fetch
fetch_metadata
fget
fillp
foreach
fset
fstat
fullpath
get_clipboard
get_display
get_draw_target
get_spr
include
input
key
keyp
line
ls
map
max
memcpy
memmap
memset
menuitem
mget
mkdir
mouse
mouselock
mset
music
mv
note
on_event
open
oval
ovalfill
peek
peek2
peek4
peek8
peektext
pget
pid
pod
poke
poke2
poke4
poke8
printh
pset
pwd
readtext
rect
rectfill
rm
rrect
rrectfill
scoresub
send_message
set_clipboard
set_draw_target
set_spr
sfx
sin
socket
split
spr
sspr
stat
stop
store
store_metadata
sub
time
tokenoid
type
unmap
unpod
userdata
vec
vid
window
create_process(prog_name_p, [env_patch])
Overview
create_process runs a process, prog_name_p, with optional env data patched in through [env_patch];
This can be done to package multiple pieces of software into one, alongside allowing for multi-process software.
Source: source.lua
Arguments
prog_name_p
The filepath to the file of which to create a process from.
This is typically a picotron cartridge or a .lua file.
[env_path]
Optional argument
This allows you to patch environmental information to the process in the form of a table.
Examples
This creates a process, running app.p64 where app.p64 prints the text that was fed into it.
When this process runs env(), it contains the argument text.
create_process("app.p64",{text="Hi!"})
Within app.p64:
print(env().text);
Sandboxed Nature
Sandboxed apps can only create processes of:
- /system/apps/filenav.p64
- /system/apps/notebook.p64
- /system/util/open.lua
- /system/util/ls.lua
- files stored within the sandboxed app
- apps from
bbs://
All apps run through this are also sandboxed
Returns
This function returns the process id of the created process & an error string.
If the process created is a process that they cannot create > nil, "sandboxed process can not create_process()"
If the process creates more than 20 processes in a single minute > return nil, "sandboxed process can not create_process() more than 20 / minute"