3790 posts
Location
Lincoln, Nebraska
Posted 19 September 2012 - 10:47 PM
I am wanting to add a logging script into my program, for error reports, and the such, but I would like to know if there is a maximum file size for files in CC. I seem to remember hearing this, but I can't find a post anywhere about it.
If there is a maximum file size, how do I have a program create a logfile to post actions taken, then only keep the last few actions completed? I already know how to create a save file, but to do a logfile would be difficult I think.
864 posts
Location
Sometime.
Posted 19 September 2012 - 11:00 PM
1.41 has it.
Go to your config files in your MC folder, you can change the value.
3790 posts
Location
Lincoln, Nebraska
Posted 19 September 2012 - 11:03 PM
I'm not at my Minecraft computer right now, but there is, huh? That makes problems for me. I need my log to be available on multiple systems/servers. I guess I'll have to find a way to keep only the last few actions completed. TO THE CODEATORIUM!
1604 posts
Posted 19 September 2012 - 11:27 PM
I'm not at my Minecraft computer right now, but there is, huh? That makes problems for me. I need my log to be available on multiple systems/servers. I guess I'll have to find a way to keep only the last few actions completed. TO THE CODEATORIUM!
The default size is 2MB per computer/turtle, and 512KB for disks. So, unless you plan to create log file of more than 1MB, you should be fine.
Also, you can remove the limit by setting it to 0.
3790 posts
Location
Lincoln, Nebraska
Posted 19 September 2012 - 11:32 PM
Alright. So now that I know there is a file size limit, Anyone know what happens when the file is too big? I'm just covering all my bases here, in the unlikely event that the log file gets too big. If fs.writeLine() just deletes the top line and adds the bottom line, that is fine for me, it just means less coding. Otherwise, I'm going to try to find a way to write maybe the last 25 actions.
686 posts
Posted 20 September 2012 - 05:25 AM
Keep in mind that's the limit for the ENTIRE STORAGE SPACE of the computer or disk. As far as I know there is no per-file limit, and I'm not sure how it handles exceeding the size, especially when one single file is taking up the whole space.
3790 posts
Location
Lincoln, Nebraska
Posted 20 September 2012 - 03:42 PM
Well, I guess I'll write a sample program to test this. Posting the ticks in a file, and adding to a new line. When the program errors, that's how big. But i don't need to error out, I can just use tables to add to the last line, then remove the first line.