3 posts
Posted 20 August 2014 - 04:43 PM
this is a simple question. i need to run a program that will need a regular updating on 51 computer, so on each computer i will do a startup saing to shell.run from the disk drive on drive_5.
On drive_5 there will be a floppy disk that will have the program i need and there will be a computer for editing the flopy disk.
so this is my question. how to run a program from the flopy disk when it's not on the side of the computer?
tanks to all helpers who will help my problem.
P.S. sorry for bad spelling, i live in Québec and i usely talk français.
Filyx20
7083 posts
Location
Tasmania (AU)
Posted 21 August 2014 - 06:01 AM
shell.run("disk5/program")
Remember, you need to right click the modem attached to the disk drive to enable it, or the attached computers won't be able to see it.
The exact folder which refers to the disk drive you want varies depending on the amount of disk drives with disks in them connected to the network. If you wanted to check all attached disk drives for a file with a certain name, you could do something like:
local fileList = fs.list()
for i=1,#fileList do if fs.exists(fs.combine(fileList[i],"yourTargetProgramNameHere")) then
shell.run(fs.combine(fileList[i],"yourTargetProgramNameHere"))
break
end end
Edited on 21 August 2014 - 04:01 AM
3 posts
Posted 21 August 2014 - 05:41 PM
second question, if i do
local x = Instrumentum
shell.run(fs.combine(fileList[i],"redstoneAspectCall"))
will the x variable be pass on to the program i shell.run cause my 51 computer need to logistic pipe request 51 diferent mana been?
3057 posts
Location
United States of America
Posted 21 August 2014 - 07:46 PM
second question, if i do
local x = Instrumentum
shell.run(fs.combine(fileList[i],"redstoneAspectCall"))
will the x variable be pass on to the program i shell.run cause my 51 computer need to logistic pipe request 51 diferent mana been?
No. If you define it globally, it will be though.
x = Instrumentum
7508 posts
Location
Australia
Posted 22 August 2014 - 06:41 AM
but as opposed to polluting the global space, the best way would be to have it as an argument for the program.
Main program
local x = 5
shell.run("other", x)
Other program
local args = {...}
print( args[1] ) --# this will print 5