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

Data Storage in Labels

Started by Geforce Fan, 04 August 2014 - 01:58 AM
Geforce Fan #1
Posted 04 August 2014 - 03:58 AM
I recently noticed that there is no cap on disk labels(from misinterpreting a suggestion :)/> ). This can be used to store any ammount of data with a single disk. I've stored up to 7.3MB and counting so far without a problem in the disk name. I think it should be capped to 64 characters or something max, or else this will get abused.
Edited on 15 August 2014 - 09:01 AM
Saldor010 #2
Posted 04 August 2014 - 04:03 AM
That's hilarious. :lol:/>
TurtleHunter #3
Posted 04 August 2014 - 04:55 AM
You got me an idea for a new program…
Geforce Fan #4
Posted 08 August 2014 - 07:20 PM
yeah, don't store data this way, it's sure to be patched. You're right, it's hilarious that they overlooked it, not realizing floppies have infinite storage capacity because of it
MatthewC529 #5
Posted 11 August 2014 - 09:34 AM
There is a hard limit at some point. Possibly around (2^31)-1 bytes. But I believe it is stored in NBT so it's likely the max value of a signed short. Or approximately 32 MB ((2^15) - 1 for a 16 bit signed integer [short]). If I am wrong it's beyond ridiculous…

Edit: Confusing my words, I was wrong but confusing my words is even worse!
Edited on 12 August 2014 - 08:43 PM
theoriginalbit #6
Posted 11 August 2014 - 09:56 AM
There is no limit imposed by NBT data, you'd hit a limit due to how much the string data type can store, so (2^31)-1 characters.
Saldor010 #7
Posted 11 August 2014 - 07:44 PM
There is no limit imposed by NBT data, you'd hit a limit due to how much the string data type can store, so (2^31)-1 characters.

For those who want to see how much data that is, but don't want to do the math.

Spoiler2 to the power of 31 = 2147483648
2147483648 - 1 = 2147483647

For these following calculations, I am assuming 1 character is equal to 1 byte.

2147483647 / 1024 = 2,097,152 kB

OR

2097152 / 1024 = 2,048 mB

OR

2048 / 1024 = 2 gB
Edited on 11 August 2014 - 05:45 PM
MatthewC529 #8
Posted 12 August 2014 - 09:41 AM
There is no limit imposed by NBT data, you'd hit a limit due to how much the string data type can store, so (2^31)-1 characters.

Sorry you are right I was thinking of metadata. NBT would be a signed integer.
theoriginalbit #9
Posted 12 August 2014 - 10:08 AM
Sorry you are right I was thinking of metadata. NBT would be a signed integer.
yeah having the limit be at metadata would mean a whole of two characters could be stored. so yes, definitely the cap is Integer.MAX_VALUE (since Java doesn't have unsigned ints).
natedogith1 #10
Posted 15 August 2014 - 04:12 AM
This also applies to Computer labels.
Edited on 15 August 2014 - 02:19 AM
InputUsername #11
Posted 15 August 2014 - 10:07 AM
So these too-often-suggested HDD peripherals (with gigabytes of data) were unintentionally added after all :D/>
valithor #12
Posted 19 August 2014 - 09:53 PM
It should be noted that putting enough information on floppies using this method could cause a crash. Once at least on lualand a floppy had a 200,000+ character label in a disk drive which when interacted with caused the player to disconnect and be unable to reconnect to the server.
immibis #13
Posted 25 August 2014 - 03:20 AM
So these too-often-suggested HDD peripherals (with gigabytes of data) were unintentionally added after all :D/>
What would you do with GBs of data in ComputerCraft? I don't think I've ever filled up a single disk.
theoriginalbit #14
Posted 25 August 2014 - 05:15 AM
What would you do with GBs of data in ComputerCraft? I don't think I've ever filled up a single disk.
I agree that GB is overkill, but several MB would be useful… I wrote a program once that in total was ~3MB in size. And I know that Oeed could make OneOS fill several MB easily.
dan200 #15
Posted 29 September 2014 - 11:29 AM
Fixed in 1.64!