10 posts
Posted 10 June 2014 - 01:16 AM
In my 'startup' program it is supposed to run the program 'gpsstartup'
Both programs are on a floppy disk.
What do i type to get to the correct path? I know its something like the below.
Shell.run (cddisk"gpsstartup")
1326 posts
Location
Error 404: Could not find.
Posted 10 June 2014 - 01:26 AM
What you need to do is
shell.run("disk/gpsstartup") IF in disk.
you put things like disk/program or games/game because they are in a directory.
if it isn't in a directory then you do
shell.run("gpsstartup")
However, in your case they would be two
"disk" and "disk2"
if you had two disk drives then you need to figure out which is the correct drive.
If not then it is impossible to run a program on a disk in a disk drive to have it run a disk that isn't in a disk drive.
if it is one disk though just do
shell.run("gpsstartup")
Edited on 09 June 2014 - 11:27 PM
7508 posts
Location
Australia
Posted 10 June 2014 - 01:32 AM
ctpdeath58's method is good, however if you want to code the program so it can find the correct path without knowing where the disk drive is, you can do it one of two ways.
The first way, using the path of the running program with
shell.getRunningProgram (which is the startup), and finding the path with a combination of
string.sub and
fs.getName.
The second way, searching all drives around the computer (using
peripheral.getNames and
disk.isPresent), getting their mount path with
disk.getMountPath and checking for the existence, of the mount path plus the file you're after, with
fs.existsThe first way would probably be the easier one, and would work as long as the second program is with the startup program, however the second approach would be better if you have no idea where the second program is located.
1326 posts
Location
Error 404: Could not find.
Posted 10 June 2014 - 01:38 AM
That is also a good method as well.
Both ways are useful.
My Advice:
If you actually know where it is:
Mine or His.
if you don't:
His
Reason: First, My won't actually see where it is. it will just do it from what is specified. His can actually find it and execute it accordingly.