This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Simdorn's profile picture

Computer OS problem? "File not found" for all inputs

Started by Simdorn, 29 June 2014 - 08:29 PM
Simdorn #1
Posted 29 June 2014 - 10:29 PM
This problem is with computers only, not turtles.
I wrote a simple program that monitor and relays switch positions ( the program is not the problem, so no code..). When opened the computer and tried to load the program, it responded "File not found".
I tried several commands ( ls/list, mkdir, clear, lua, shutdown…) and they all respond "File not found".

My guess is somehow the computers is not looking at the right directory to find system commands and programs??

I have written about 20 turtle programs for players in 'our world'.. and have never had a problem with them.

Hoping someone can give me a clue….


Almost Clueless….
Sim
Link149 #2
Posted 29 June 2014 - 11:42 PM
Your program might have edited the Shell's Path variable, which allows some programs to be 'seen' by the OS, whatever is your current directory. Usually CraftOS' path is something like: ".:rom/programs/", where '.' is the root of the computer and "rom/programs/" is the directory for the programs shipped with the OS by default. The ':' character serves as a separator, so you can append multiple paths to your Path variable.

Double check to see whether your program calls "shell.setPath()", if it does and it absolutely need to change it then make sure to concatenate the previous path before adding anything else.


local somePath = "myPrograms/someProgram/"
local currentPath = shell.path()

shell.setPath(currentPath .. ':' .. somePath)
Edited on 29 June 2014 - 09:43 PM
Simdorn #3
Posted 30 June 2014 - 12:06 AM
Thank you, that's a good thought and I looked in the configs to see if something was doing something similar there.. but no.

I don't set/reset the shell path in my program, the only 'shell' command i have is .. shell.run"clear"
I keep my programs pretty simple :)/>

The path I use for programming turtles is:
../FTBMonster/mods/ComputerCraft1.58/assets/computercraft/lua/rom/programs/turtle

I used the
../FTBMonster/mods/ComputerCraft1.58/assets/computercraft/lua/rom/programs/computer

to store the computer program, but.. like I said.. nothing.
and the system commands give the same error..


Sim
Bomb Bloke #4
Posted 30 June 2014 - 01:59 AM
You extracted and deleted the ComputerCraft zip, didn't you… Unfortunately that's a no-no. In my tests it can be done from CC 1.6 on (where it moved to a jar instead), but prior to that, forget about it.
Simdorn #5
Posted 30 June 2014 - 02:35 AM
OK..
I don't know what caused the problem, but it is fixed. The person running our server rebooted the whole machine and everything is working as it should

Sorry to have bothered you with this issue ( need to take my own advice.. have you rebooted your computer??…. duh )

Thank you

Sim