7 posts
Posted 01 February 2015 - 11:58 PM
Hello there,
I was messing around with the free space i had left on my disk and i realized that whenever i created a new
DIRECTORY or when i delete an existing empty
DIRECTORY, the size returned by fs.getFreeSpace() is
512 bytes bigger than without the new directory/empty file or removed directory/empty file. Can anyone explain this (is the disk size really increased by 512 or its an error/glitch) :huh:/>? Does this mean i could "glitch" my disk size to 1gb and not have to worry about disk space B)/>?
Proof:
Spoiler
P.S. Should i have posted this in the "bugs" section? If so, feel free to move this thread.
Thanks for your answers!
1220 posts
Location
Earth orbit
Posted 02 February 2015 - 03:16 AM
I believe that (or something very similar) was
already reported in the bugs section.
8543 posts
Posted 02 February 2015 - 03:54 AM
Moved to Bugs.
496 posts
Location
New Zealand
Posted 02 February 2015 - 09:45 AM
I tweeted Dan about this, he says it's fixed for the next version
fixed for the next version
355 posts
Location
Germany
Posted 02 February 2015 - 12:05 PM
maybe somone should create a custom section for the bios to prevent this for all past versions. Because I can already see how people will make a loop increasing the freeSpace and writing to it to the point, where the harddrive is full. I've heard of tekkit classic servers dealing with this issue to an extend, where 8TB RAID systems have been fludded with 100KB files in computers, so that theres no space left for the actual server.log file to be written.
I could imagine this can become a problem to all servers having computercraft installed to this moment, again.
496 posts
Location
New Zealand
Posted 02 February 2015 - 12:34 PM
maybe somone should create a custom section for the bios to prevent this for all past versions. Because I can already see how people will make a loop increasing the freeSpace and writing to it to the point, where the harddrive is full. I've heard of tekkit classic servers dealing with this issue to an extend, where 8TB RAID systems have been fludded with 100KB files in computers, so that theres no space left for the actual server.log file to be written.
I could imagine this can become a problem to all servers having computercraft installed to this moment, again.
You wouldn't be able to because of all the filesystem handling being done in Java
Edited on 02 February 2015 - 11:36 AM
355 posts
Location
Germany
Posted 02 February 2015 - 12:37 PM
maybe somone should create a custom section for the bios to prevent this for all past versions. Because I can already see how people will make a loop increasing the freeSpace and writing to it to the point, where the harddrive is full. I've heard of tekkit classic servers dealing with this issue to an extend, where 8TB RAID systems have been fludded with 100KB files in computers, so that theres no space left for the actual server.log file to be written.
I could imagine this can become a problem to all servers having computercraft installed to this moment, again.
You wouldn't be able to because of all the filesystem handling being done in Java
It's a little complicated, but it's possible as you can override fs.open and fs.makeDir
oh, and copy, move and that stuff too ofcourse
355 posts
Location
Germany
Posted 02 February 2015 - 01:09 PM
I am currently not able to test this, but does the freespace reset after the mod gets reloaded (ie. server restart)?
I would guess so, so only current directorys need to be taken into account, when writing a fix. (Since you can't save the difference between getFreeSpace and the realFreeSpace in case of any reboots/shutdowns of the computers without a file, which would make this stuff even harder to fix within lua in a secure manner
7083 posts
Location
Tasmania (AU)
Posted 02 February 2015 - 01:31 PM
In the past, I've found that sometimes getFreeSpace starts returning 0 no matter how much data is really on the system (typically after attempting to write a load of data to an open file, enough to actually fill the "drive"). This typically requires a restart of the entire game in order to correct it - just rebooting the affected computer isn't enough, let alone simply emptying out its drive via eg Windows Explorer.
524 posts
Location
Cambridge, England
Posted 02 February 2015 - 09:20 PM
Fixed in 1.66pr4