Board Thread:General Discussion/@comment-5873739-20121215150453

I recently noticed that ComputerCraft has changed the way it handles its files. I thought I might bring this up as it may be confusing some people; I know it confused me. This is regarding the Tekkit version 3.1.3.

In the past, you were able to easily edit and replace files from Disks in ComputerCraft, by locating the 'world' folder in your server's directory, navigating to its computer>disk folder and opening up the folder with the id of your Disk. You could then add, remove or edit any of the files therein with an external editor such as Notepad++, and it would be updated when you next loaded up the server (or even instantly; I can't quite remember).

However, there seem to have been some changes. First of all, the world folder no longer exists. Everything has now been moved to the folder of your server's world's name. For example, if your server's world name was 'Brian', the folder where you can find your CC folders is now server_folder>Brian>computer. Possibly, if you have computers in the Nether, this information has been moved to server_folder>Brian_nether>computer, but this will have to be confirmed. Second, there seems to be some kind of failsafe system built into the server's storage data somewhere, as when you delete the computer folder in its entirety, a new folder is made the next time you load the server, and the following folders are added: disk, with all the Disks' folders, and folders in the computer directory with the id numbers of said Disks as they were in the world. However, these folders are empty. The server only remembers that there once were Disks, but not what these Disks contained.

Secondly, when a new Disk is created, its information is contained in the computer>disk folder as mentioned before. You may have noticed, though, that there is also a folder in the computer directory that contains all of this Disk's data. Similarly, should any of your Disks be labelled, the labels.txt from the disk folder is also located in the computer directory. Although it may seem as if the two folders - the one with the Disk's id in disk and the one with the Disk's data in computer - are identical, they are in fact not. When editing files inside the computer folder, you will find that next time you load up the server, your changes have been reverted. Also if you delete files from it, they will simply be replaced. However, if you edit or delete files from the disk folder, the changes are carried over to the folders inside computer. Apparently, the disk folder is instanced over into the computer folder, probably as means of a backup system. The trail of thought behind this is unclear to me, but I assume that CC first edits the files in the computer folder when you edit things in-game, and that that disk folder is never updated until the server has succesfully closed down. However, when you edit the files in the computer folder externally, CC sees it as a corruption and replaces the changed files with the original ones from the disk directory the next time the server restarts. This is what I think is happening.

So, to edit Disk code externally, you will have to alter the files in the world_name>computer>disk folder. Overall, this is not that big of a change in the way that ComputerCraft worked; files from the disk folder are still the files you'll be working with, but the newly instanced files in the computer folder had me confused and the constant replacement of these files had me running around looking where the replacing files were coming from. I can imagine other people having the same problems and being similarly confused, which is why I thought it might be nice to inform you of my findings.

Happy coding and - of course, as they are inbound - Happy Holidays!

~Shrooblord 