Hallo, First I Show My Problem in German and An then in English.
Ich habe versucht Systemdaten in dateien zu speichern und dann zu laden:
datei = fs.open("programme.system", "r")
p1 = datei.readLine()
datei.close()
Aber der Computer sagt in Zeile 2 gibt es eine "attempt to index - a nil value"
Warum?
I tried to write data in a file and load it. I wrote:
datei = fs.open("programme.system", "r")
p1 = datei.readLine()
datei.close()
But the computer says "attempt to call index - a nil value" whY?
7 replies to this topic
#1
Posted 15 August 2017 - 01:20 PM
#2
Posted 15 August 2017 - 01:50 PM
Moved to Ask a Pro.
#3
Posted 15 August 2017 - 02:48 PM
German:
Wahrscheinlich existiert die Datei "programme.system" nicht.
English:
I think the file "programme.system" doesn't exists.
Wahrscheinlich existiert die Datei "programme.system" nicht.
English:
I think the file "programme.system" doesn't exists.
#4
Posted 16 August 2017 - 02:57 PM
It exists
#5
Posted 17 August 2017 - 06:26 AM
You haven't provided the full error. Which line number is specified?
It does seem most likely that your specified file doesn't exist, though. Remember that the fs API uses absolute paths - if the file isn't on the root of your drive, you might need to use shell.resolve().
The next most likely scenario is that the file is locked. Make sure you don't already have it open elsewhere.
It does seem most likely that your specified file doesn't exist, though. Remember that the fs API uses absolute paths - if the file isn't on the root of your drive, you might need to use shell.resolve().
The next most likely scenario is that the file is locked. Make sure you don't already have it open elsewhere.
#6
Posted 19 August 2017 - 08:13 PM
Ok, i think I know what you mean. Buy have the path to start at C:\ or at the folder of this PC?
#7
Posted 19 August 2017 - 11:49 PM
"Absolute path" refers to the path you'd use to access it if your current directory were the root directory.
For example, the shell program's absolute path is "rom/programs/shell" (or "/rom/programs/shell", the "/" forces it to be interpreted as absolute),
For example, the shell program's absolute path is "rom/programs/shell" (or "/rom/programs/shell", the "/" forces it to be interpreted as absolute),
#8
Posted 20 August 2017 - 07:38 PM
Okay, I'll try it. Thank you very very much.
Okay, I'll try it. Thank you very very much.
Okay, I'll try it. Thank you very very much.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











