Hi, quite a while ago I asked for some help. it turned out that APIS cant access shell for a shell.run, is there any way to work around this?
Accessing Shell In An Api
Started by makerimages, Aug 19 2013 03:34 AM
3 replies to this topic
#1
Posted 19 August 2013 - 03:34 AM
#2
Posted 19 August 2013 - 04:35 AM
Pass the shell table to the API - make the API store the reference of the shell table, and there you go, the API can call the functions in the shell table you gave it. I thought of something like this:
Then the program which uses the API would look like this:
-- first lines of the API
local passedShell
function setShell(sl)
passedShell = sl
end
-- * ...
function someFunctionThatUsesShell(...)
passedShell.run(...)
end
Then the program which uses the API would look like this:
os.loadAPI("someapi")
someapi.setShell(shell)
someapi.someFunctionThatUsesShell("something")
#3
Posted 19 August 2013 - 10:25 AM
Will try.
#4
Posted 19 August 2013 - 01:49 PM
APIs can use os.run instead, but it's generally unnecessary to run files from an API.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











