Shell.setPath

From ComputerCraft Wiki
Revision as of 04:02, 3 October 2013 by Alekso56 (Talk | contribs) (adding page for shell.setPath)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Grid Redstone.png  Function shell.setPath
Sets the working path.
Syntax shell.setPath(string path)
Returns nil
Part of ComputerCraft
API shell

Examples

Grid paper.png  Example
If turtle then change to turtle path.
Code
local sPath = ".:/rom/programs"
if turtle then 
 sPath = sPath..":/rom/programs/turtle" 
else 
 sPath = sPath..":/rom/programs/computer" 
end
shell.setPath(sPath)

Additional Notes

  • It does not output anything, it just sets the path.