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

Volatile memory directory (unlimited size, not written to the server)

Started by JJRcop, 13 April 2013 - 05:01 PM
JJRcop #1
Posted 13 April 2013 - 07:01 PM
My proposal is to have a directory such as "\mem", or whatever you come up with, that is volatile, that is, only persistent while the computer is on and loaded.

My reason for it is I want to be able to translate my file to npaintpro/paint's filetype.
(My file is around four times smaller than the native npaintpro filetype, as it saves each pixel as four bits of a byte, instead of two bytes like npaintpro does.)

I don't want a big ugly error when someone fills their drive with only a few remaining bytes left for use, or if the maximum size is weirdly low, so if there is volatile memory, it doesn't even save to the computer and will be simply stored in memory until the computer is either unloaded or turned off.

EDIT: I'm going to translate it, then write it to a file and call npaintpro with the file as the argument, then translate it back to my filetype and write to the original file my program was called with
Edited on 13 April 2013 - 05:28 PM
oeed #2
Posted 13 April 2013 - 11:04 PM
I think see what you mean, but either I'm miss understanding you or you don't have a full grasp on how multiplayer works.

You can't store it locally, the server handles everything, even key presses. How would other users use it?

Why not just store it in memory (as a variable)?
immibis #3
Posted 13 April 2013 - 11:11 PM
You could write this yourself in Lua.
JJRcop #4
Posted 14 April 2013 - 04:29 AM
I see some of you may be thinking: Why not just store it in a variable?
But how can I call another program made for using files as input, using a variable as the argument, without editing the program itself?

EDIT: I see, overwrite the fs API.. Mkay guess I'm going to have to hack around a problem again.
Cloudy #5
Posted 14 April 2013 - 05:04 AM
It isn't our job to provide solutions to your problems. That is your job. If you can do it in Lua you should.
JJRcop #6
Posted 14 April 2013 - 05:19 AM
Thanks, I understand.