This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Data Storage in Labels
Started by Geforce Fan, 04 August 2014 - 01:58 AMPosted 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
Posted 04 August 2014 - 04:03 AM
That's hilarious. :lol:/>
Posted 04 August 2014 - 04:55 AM
You got me an idea for a new program…
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
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!
Edit: Confusing my words, I was wrong but confusing my words is even worse!
Edited on 12 August 2014 - 08:43 PM
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.
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.
Spoiler
2 to the power of 31 = 21474836482147483648 - 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
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.
Posted 12 August 2014 - 10:08 AM
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).Sorry you are right I was thinking of metadata. NBT would be a signed integer.
Posted 15 August 2014 - 04:12 AM
This also applies to Computer labels.
Edited on 15 August 2014 - 02:19 AM
Posted 15 August 2014 - 10:07 AM
So these too-often-suggested HDD peripherals (with gigabytes of data) were unintentionally added after all :D/>
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.
Posted 25 August 2014 - 03:20 AM
What would you do with GBs of data in ComputerCraft? I don't think I've ever filled up a single disk.So these too-often-suggested HDD peripherals (with gigabytes of data) were unintentionally added after all :D/>
Posted 25 August 2014 - 05:15 AM
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.What would you do with GBs of data in ComputerCraft? I don't think I've ever filled up a single disk.
Posted 29 September 2014 - 11:29 AM
Fixed in 1.64!