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

Hard Drive

Started by CastleMan2000, 25 September 2012 - 10:18 PM
CastleMan2000 #1
Posted 26 September 2012 - 12:18 AM
Hello. With the new memory limitations in 1.4, why not have a external hard drive? I know you could just store your extra stuff on floppies, but what if you, say, wanted a big database? It would be hard to keep a huge bunch of files on one computer. I threw up a quick mock-up of the front texture in Paintbrush. First texture is the lights off, default state.


Next is all of the lights on.


Sorry if it's a bit small, but the three lights, from top to bottom, are Connection (i.e if it is connected to a computer or not), Read, and Write. The read and write lights would blink when their respective actions are being done.

The recipe could be:
IRI
IGI
III

Where I = Iron ingot, R = Redstone dust, and G = Gold ingot.

To balance it out a little, it would have a delay when writing or reading from the hard disk. It could be compatible with the fs API, or maybe have it's own. harddrive.write(data,address) would accept floating, string, or table, and harddrive.read(address) would return a table containing the data from the address. The address would be for keeping the data in certain locations. Each address could hold maybe 128k of data, and the addresses would be from 1 to 32. This would give the hard drive approximately 4096 KB of storage, or 4 MB.

Some sample code for reading and writing some stuff.


print("Hi! What is your name?")
local input = io.read()
harddrive.write(input,1)
local names = harddrive.read(1)
print("Guess who visited me last? It was "..names[-1])

Please tell me what you think of this idea.
Lettuce #2
Posted 26 September 2012 - 12:56 AM
dan200 implemented that for multiplayer servers so massive malicious programs to lag/crash the server, wouldn't happen. These harddrives would defeat the purpose. You can increase, decrease, or eliminate the limit entirely in config for servers or SSP.
Noodle #3
Posted 26 September 2012 - 01:21 AM
dan200 implemented that for multiplayer servers so massive malicious programs to lag/crash the server, wouldn't happen. These harddrives would defeat the purpose. You can increase, decrease, or eliminate the limit entirely in config for servers or SSP.
I think he means an actual hard drive for it.. It'll help since a lot of servers don't know how to change config -.-
immibis #4
Posted 26 September 2012 - 02:27 AM
So don't play on crap servers?
Zoinky #5
Posted 26 September 2012 - 03:04 AM
It would be cool if you could detect when the drive is full on the comp. Then you could make a program to send it to other comps that you've set up to hold the extra programs.

EDIT: Or can you? Not sure. I was guessing we can't.
immibis #6
Posted 26 September 2012 - 05:16 AM
It would be cool if you could detect when the drive is full on the comp. Then you could make a program to send it to other comps that you've set up to hold the extra programs.

EDIT: Or can you? Not sure. I was guessing we can't.

You can, because it won't let you save more data if it's full, and fs.getFreeSpace("/") will return a small number.
Sebra #7
Posted 26 September 2012 - 05:44 PM
Hello. With the new memory limitations in 1.4, why not have a external hard drive? I know you could just store your extra stuff on floppies, but what if you, say, wanted a big database?
What are you want to store in comp? P-video? What are you make if current drive size is not enough for you? Want to store more than floppy, use several floppies.
p.s. P- means "personal" :P/>/>
Cranium #8
Posted 26 September 2012 - 06:29 PM
I would very much like to see a computercraft folder that reaches size limits. If you have done so without implementing a file generator, then congratulations, you have HUGE amounts of code. Even with my troll file spammer running constantly for an hour, I have never hit the folder limit. All it does is create useless files. Why would we need additional storage?
CastleMan2000 #9
Posted 26 September 2012 - 06:37 PM
I know you could just store your extra stuff on floppies,

Yes, I am aware of that, but you would still need to have multiple floppy drives attached, or cycle through them. The hard drive would store a lot more, but it would be stationary. Some people just need giant databases, and this would work for them.

Admittedly, my dad just couldn't grasp how the computer had no hard drive for persistent storage.
Cloudy #10
Posted 26 September 2012 - 07:08 PM
I know you could just store your extra stuff on floppies,

Yes, I am aware of that, but you would still need to have multiple floppy drives attached, or cycle through them. The hard drive would store a lot more, but it would be stationary. Some people just need giant databases, and this would work for them.

Admittedly, my dad just couldn't grasp how the computer had no hard drive for persistent storage.

Who says it doesn't? You don't see the internals of the computer :P/>/>

Anyway, someone could easily make this as a peripheral - but the default limit is huge when you're talking about small code files.
Cranium #11
Posted 26 September 2012 - 07:35 PM
Did he not grow up with computers that had no hard drives? My dad still remembers entering data with punch-cards….
jag #12
Posted 26 September 2012 - 08:55 PM
The recipe would make sense if it where like this

S G S
S R S
S S S

where S = stone (not cobble), R = redstone & G = gold ingot.
Because, all of the other stationary CC machines is made out of stone.
CastleMan2000 #13
Posted 26 September 2012 - 09:03 PM
This is Dad.

When my son told me that ComputerCraft computers have 2MB of storage, I said, "You mean they have a 2MB hard drive." He replied, "No, the computer has 2MB of storage. It doesn't have a hard drive." We discussed various memory storage media. I figured that if the computer used floppy disks, it must have a hard drive. He kept insisting that there was no such thing. Memory was stored on the "computer".

I just figured, to avoid confusion with how things work in the real world, ComputerCraft computers should have hard drives.
GopherAtl #14
Posted 26 September 2012 - 09:33 PM
They do. They're internal, like on most computers.

External bulk storage in the CC universe of quasi-1980s-tech? Tape drives, treated as a single fixed-size file with only seek(index), write, and read commands. Ideally with the seek index stored as metadata on the tapes, so you can't quickly rewind by ejecting and reinserting them.

heh. As with vector monitors, I expect I'm the only one who's gonna think this is a neat idea. Of course, it's also useless unless hd and floppy storage sizes were slashed down to something actually confining rather than just something to insulate servers.
Sebra #15
Posted 28 September 2012 - 07:03 PM
I figured that if the computer used floppy disks, it must have a hard drive.
I worked on computer with two floppy*720k, one RAM disk 512K clear on boot, no hard drive at all.
If you cannot imagine something it can still exist. :P/>/>