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

[Not Solved] Any Writing To Files Attempts To Index A Nil Value.

Started by Shnupbups, 18 August 2013 - 06:27 PM
Shnupbups #1
Posted 18 August 2013 - 08:27 PM

The title and images explain it all really. I can't write to files with edit, I can't use pastebin, thunderhawk…

EDIT: cropped picture
EDIT2: added another picture
Lyqyd #2
Posted 18 August 2013 - 09:48 PM
Is your save directory read-only? Can you read files?
Shnupbups #3
Posted 18 August 2013 - 10:09 PM
Is your save directory read-only? Can you read files?
I don't think it's read only… and yes, I can read. It's just writing.


EDIT: Checked, and for some reason my whole AppData folder was read only… I have no idea why, I never did that :\
EDIT2: Still doesn't work, does the same thing! I completely read-only'd AppData, but still it comes up with things such as:


pastebin:101: attempt to index ? (a nil value)
electrodude512 #4
Posted 19 August 2013 - 11:04 PM
Windows is stupid and won't let you unreadonly AppData, although it may show that it has. It also has its Virtual Store which might be eating your files. What version of Windows are you using? What launcher do you use? Try unreadonlying .minecraft, .minecraft/saves, .minecraft/saves/yourworld, .minecraft/saves/yourworld/computer, and at least on computer (do the rest later after it works) until it works.

Can you write to a file that already exists? Put a text file in .minecraft/saves/<yourworld>/computer/<yourcomputerid>/ and see if you can write to it.

This is reason #3958619745 for not using Windoze (yes there are that many).
KaoS #5
Posted 27 August 2013 - 07:05 AM
go to cmd and enter

for /f "delims=" %i in ('dir /b /s "%appdata%"') do attrib -r "%i"
to remove read only from everything in the appdata directory. you can use it for any dir really but be warned, it can take a while if you have a lot of files in there

you can also use

attrib -r "%appdata%" /s /d
but I have not tested that one before
OpieThePug #6
Posted 27 August 2013 - 09:08 PM
I'd just like to mention that although KaoS might be right, I think
"test"
should be highlighted red because of syntax highlighting.
KaoS #7
Posted 28 August 2013 - 02:02 AM
lol the first suggestion is tested and does work. The second one was an assumption I made based on the help file of the attrib command. I've used the for /f loop before for this (whatever you do don't use the for /R to go through the dir cuz it doesn't give full path, you can make it do so but I can't remember how)
Shnupbups #8
Posted 28 August 2013 - 05:33 PM
lol the first suggestion is tested and does work. The second one was an assumption I made based on the help file of the attrib command. I've used the for /f loop before for this (whatever you do don't use the for /R to go through the dir cuz it doesn't give full path, you can make it do so but I can't remember how)
OK, I'm trying it now.
EDIT: Didn't work still :(/>

Might the problem have something to do with the fact I'm using the new 1.6 launcher to launch it in a different .minecraft? (Located at %appdata%\.minecraft\CC)
PixelToast #9
Posted 29 August 2013 - 10:10 AM
the folder might have a file lock of some sort on it
have you tried using unlocker?
KaoS #10
Posted 29 August 2013 - 04:14 PM
I'm just wondering but is your save in the appdata directory?? If not please re-run the above script and replace %appdata% with the full path to your save folder. If that does not work try


echo This is a test to see if cmd can create files in the save directory>FULLPATHTOSAVE\testFile

replace FULLPATHTOSAVE with the correct path and it should error if you are unable to edit files in that location, with that error we might be able to do something. If it can create the file then backup your save dir and delete MC, re-download and mod it, test on a new save and if successfull try your old save again
Shnupbups #11
Posted 30 August 2013 - 03:44 AM
I'm just wondering but is your save in the appdata directory?? If not please re-run the above script and replace %appdata% with the full path to your save folder. If that does not work try


echo This is a test to see if cmd can create files in the save directory>FULLPATHTOSAVE\testFile

replace FULLPATHTOSAVE with the correct path and it should error if you are unable to edit files in that location, with that error we might be able to do something. If it can create the file then backup your save dir and delete MC, re-download and mod it, test on a new save and if successfull try your old save again
Located at %appdata%\.minecraft\CC
Shnupbups #12
Posted 30 August 2013 - 03:47 AM
the folder might have a file lock of some sort on it
have you tried using unlocker?
I hadn't, but now I have and it did nothing.

Look guys, I appreciate the help but I think I'm just gonna put my CC's .minecraft folder somewhere else. If that doesn't work, well, let's just say it will. Hope it will.