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

Out of Space error

Started by TYKUHN2, 09 August 2015 - 05:01 PM
TYKUHN2 #1
Posted 09 August 2015 - 07:01 PM
I believe I am filling the write buffer using fs.writeLine(). However this would suggest doing an occasional flush would fix it, and yes it does if I use flush() sleep(1) but for some reason it errors if I limit the buffer to anything bigger than 1. So my question is:

What is the buffer size. It seems kinda small.


local downloaded = http.get("http://www.ccds.bugs3.com/"..filename..".html")
local downfile = fs.open("disk/files/"..filename, "w")
local nxtline = downloaded.readLine()
repeat

downfile.writeLine(nxtline)
count = count + 1
if count == 15 then //Errors after 1 pass if anything but 20 it appears
  downfile.flush()
  count = 0
end
nxtline = downloaded.readLine()

until nxtline == "<!-- www.serversfree.com Analytics Code -->"
downfile.close()
Edited on 09 August 2015 - 05:17 PM
HPWebcamAble #2
Posted 09 August 2015 - 07:09 PM
Whats the exact error it gives you?

And is this the full code?
If not would you post the rest?
TYKUHN2 #3
Posted 09 August 2015 - 07:17 PM
The exact error is "installer:197: Out of Space"
197 is downfile.writeLine(nxtline)

Also this is not all of the code. The program was recently downsized significantly to 275 lines. Further more it is downloading another full size file of 696 lines. Posting that would mean a lot of reading. The only related code I removed was an error checker incase a download failed, a version set to finish the download, the declaration of the function and variable

function download(filename)
local count = 0

Alright ignore the fact it only passes once unless on 20, it is incorrect. Turns out it hates lines 32 and 41 I believe. 32 is a single end. 41 is a mostly empty space. Point is ignore the fact I said it only passes once.
Edited on 09 August 2015 - 05:14 PM
SquidDev #4
Posted 09 August 2015 - 07:17 PM
From memory the only time you should get an Out of Space error is when saving to a file and the drive is full. It looks like your saving to a disk, and they have smaller storage capacity than computers.

If you look in your config there is an I:floppySpaceLimit option. If you add a couple of zeros on the end then you should have plenty of space. (Adding zeros on the end is the solution to anything :)/>).
Edited on 09 August 2015 - 05:18 PM
TYKUHN2 #5
Posted 09 August 2015 - 07:21 PM
Seems incorrect because it is writing a variable number of lines. But for debug sakes I will run a quick test.

Result: fs.getFreeSpace("disk") prints out 286 every single time it runs. Seems problematic. Also note it seems to write a maximum of 40 lines before erroring. It must have more space?

Edit: I forgot to mention if I remove the custom buffer of 15 lines I think I put in the code posted here and replace it with a flush by itself it won't error at all.
Edited on 09 August 2015 - 05:23 PM
TYKUHN2 #6
Posted 09 August 2015 - 07:29 PM
I would just do a flush everytime I read a line but people would yell at me that I am writting too often to disk.
Also I cannot just write the whole thing. I use a free web host who appends code to the end of the html request. It would crash the program.
I would also give you guys the full URL (including filename) but I have known issues with the host not working for everyone.
Edited on 09 August 2015 - 05:30 PM
TYKUHN2 #7
Posted 09 August 2015 - 07:54 PM
I checked the config file because I can. I should have say 122 KB? I am using 7 for the installer and the file I downloaded is at maximum 1kb (I forget the minimum size ComputerCraft assumes it is) so I am not filling the disk up. That would be insane. Even the 696 file isn't that big.
Creator #8
Posted 09 August 2015 - 08:36 PM
If the problem persists, delete a file and see if it happens again.
TYKUHN2 #9
Posted 09 August 2015 - 08:58 PM
There are 2 files. The downloader/file writer and the file being written to. It is overwritten everytime it writes.
HPWebcamAble #10
Posted 09 August 2015 - 09:03 PM
Maybe just for fun, copy and paste your CC config onto pastebin, and put a link here, so we can see it.
TYKUHN2 #11
Posted 09 August 2015 - 09:11 PM
I'm wondering what the chances of a glitch are.

http://pastebin.com/0x3pdBPp
flaghacker #12
Posted 09 August 2015 - 09:47 PM
Those values are off by a lot, you seem to have missed this part
in bytes

Your computer space is currently ~1Mb and your disk space is ~0.1Mb. You should add a couple of 0's at the end to fix it. If you're usure about the exact numbers you need, you can do a google search like this:

10 megabytes in bytes
and it will tell you the exact numbers you need.
TYKUHN2 #13
Posted 09 August 2015 - 09:56 PM
That would suggest I have 100 KB. Again my files are no larger than 8 KBs in size together
Edited on 09 August 2015 - 07:59 PM