Jump to content




RAMDisk v2 - Store files in memory with almost unlimited capacity!


24 replies to this topic

#1 Mr. Bateman

  • Members
  • 98 posts
  • LocationAustralia

Posted 22 June 2014 - 10:09 AM

RAMDisk v2


Warning: This is not a replacement for persistent storage, so when you turn off / crash the computer, any loaded images will be removed without saving!


Posted Image


This is a simple program to use, so I'll just get to the good bits:

Usage:

ramdisk
(or any other arguments that are invalid)
This will display any loaded images, and display the proper usage.

ramdisk create <drive name>
This will load a blank image, with the name of <drive name>, which is used to access it.

ramdisk load <filename>

If <filename> points to a file:
This will load an image saved at <filename> by ramdisk save.

If <filename> points to a directory:
RAMDisk will create and load a new image with the name of the directory, and copy the contents of the directory to the new image.

ramdisk unload <drive name>
This will unload any image with the name of <drive name> that is currently loaded.

ramdisk save <drive name> <filename>
This will save the entire contents of the loaded drive with the name of <drive name> to a file specified at <filename>.
This will not save the files to an individually accessible format, instead it saves an archive.

Link: http://pastebin.com/izMaKme5
pastebin get izMaKme5 ramdisk

This requires my Virtual Filesystem API which should be automatically downloaded by RAMDisk itself, but if it does not, then use this:
pastebin get ZT1euz3x vfs

Please post any suggestions or bug reports!

Edited by ROFLCopter64bit, 14 August 2014 - 04:17 AM.


#2 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 26 June 2014 - 11:50 PM

Wow this seems really cool, Actually had an idea about creating something like this once( but I was too lazy xP )
I will test this tomorrow and give you more feedback, gotta get some sleep you know :P

#3 oeed

    Oversimplifier

  • Members
  • 2,095 posts
  • LocationAuckland, New Zealand

Posted 27 June 2014 - 12:07 AM

Yea, this does look pretty sweet.

Does anyone know what the memory limit for CC is?

In my OneOS rewrite I've been thinking that I might be starting to push it.

Edited by oeed, 27 June 2014 - 12:07 AM.


#4 Mr. Bateman

  • Members
  • 98 posts
  • LocationAustralia

Posted 27 June 2014 - 01:46 AM

View Postoeed, on 27 June 2014 - 12:07 AM, said:

Does anyone know what the memory limit for CC is?

LuaJ has no memory limit, but it's generally a good idea to not use absurd amounts of it.

#5 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 27 June 2014 - 01:49 AM

View PostROFLCopter64bit, on 27 June 2014 - 01:46 AM, said:

View Postoeed, on 27 June 2014 - 12:07 AM, said:

Does anyone know what the memory limit for CC is?
LuaJ has no memory limit, but it's generally a good idea to not use absurd amounts of it.
i would actually hazard a guess and say that the limit is whatever the limit of Minecraft is set to, so if you use too much Minecraft could start to give you memory warnings.

#6 oeed

    Oversimplifier

  • Members
  • 2,095 posts
  • LocationAuckland, New Zealand

Posted 27 June 2014 - 02:35 AM

View Posttheoriginalbit, on 27 June 2014 - 01:49 AM, said:

View PostROFLCopter64bit, on 27 June 2014 - 01:46 AM, said:

View Postoeed, on 27 June 2014 - 12:07 AM, said:

Does anyone know what the memory limit for CC is?
LuaJ has no memory limit, but it's generally a good idea to not use absurd amounts of it.
i would actually hazard a guess and say that the limit is whatever the limit of Minecraft is set to, so if you use too much Minecraft could start to give you memory warnings.
Well, if that's the case, as it probably is now I think about it, then loading a few hundred kilobytes of various APIs won't be the end of the world.

#7 Suzuha

  • Members
  • 3 posts

Posted 27 June 2014 - 10:27 PM

Couldn't this also be used to make a Temporary Files directory that automatically flushes when people reboot?
Could be useful for implementation in an OS that makes a bunch of temporary files.

#8 Geforce Fan

  • Members
  • 846 posts
  • LocationMissouri, United States, America, Earth, Solar System, Milky Way, Universe 42B, Life Street, Multiverse, 4th Dimension

Posted 02 July 2014 - 09:48 PM

oooo I should make a ramdisk and put all my important files on it then delete the files on the normal disk! that sounds like a great idea!!! *griefer comes in and shuts off computer* FUUUUUUUUU!!!!!
But anyhow yeah, great for temporary storage.

#9 Sir_Mr_Bman

  • Members
  • 62 posts

Posted 13 July 2014 - 11:06 AM

Oh wow! This looks great!

A way to store things forever using this system would be good though...


Maybe have it save the contents of the files into a sort of /tmp directory when the computer shuts off, and then when it turns back on save all the files back to ramdisk... hmm....

#10 Mr. Bateman

  • Members
  • 98 posts
  • LocationAustralia

Posted 13 July 2014 - 11:55 AM

View PostSir_Mr_Bman, on 13 July 2014 - 11:06 AM, said:

Maybe have it save the contents of the files into a sort of /tmp directory when the computer shuts off, and then when it turns back on save all the files back to ramdisk... hmm....
Maybe it could save it to an equivalent of hiberfil.sys in Windows, but the problem is there is no real way of handling when the computer shuts on or off, so that's going to be a problem.
On that note, my virtual filesystem API needs an update, and I'll probably implement something like autosaving the image files.

#11 wilcomega

  • Members
  • 466 posts
  • LocationHolland

Posted 15 July 2014 - 09:25 AM

i just realized you made a virtual folder. could you please make this work with rednet so you can have an image that is an actual folder on another server, and will syncronize and stuff

oh and in what emulator did you make this screenshot?

Edited by wilcomega, 15 July 2014 - 09:26 AM.


#12 Mr. Bateman

  • Members
  • 98 posts
  • LocationAustralia

Posted 15 July 2014 - 09:44 AM

View Postwilcomega, on 15 July 2014 - 09:25 AM, said:

i just realized you made a virtual folder. could you please make this work with rednet so you can have an image that is an actual folder on another server, and will syncronize and stuff

oh and in what emulator did you make this screenshot?
Already planned.

CCEmuRedux

#13 logsys

  • Members
  • 171 posts

Posted 15 July 2014 - 10:57 AM

Finnaly, thanks for doing this, I was searching and trying to make this for 6 months now...

#14 logsys

  • Members
  • 171 posts

Posted 15 July 2014 - 11:02 AM

Sugestion: Read-only drives... Also, run from website.. So, just like OneOS(I think it needs more space), it could run the ramdisk from the web and the OS would use those files within the read-only drive

#15 Mr. Bateman

  • Members
  • 98 posts
  • LocationAustralia

Posted 15 July 2014 - 11:15 AM

View Postlogsys, on 15 July 2014 - 11:02 AM, said:

Sugestion: Read-only drives.
Already in the API, I just need to finish it

View Postlogsys, on 15 July 2014 - 11:02 AM, said:

Also, run from website.
What do you mean by this?

#16 logsys

  • Members
  • 171 posts

Posted 15 July 2014 - 11:21 AM

View PostROFLCopter64bit, on 15 July 2014 - 11:15 AM, said:

View Postlogsys, on 15 July 2014 - 11:02 AM, said:

Also, run from website.
What do you mean by this?
Do you see pastebin run <blahblahblah>?? doing like ramdisk load <link> would create a ramdisk without having to save a current ramdisk

#17 oeed

    Oversimplifier

  • Members
  • 2,095 posts
  • LocationAuckland, New Zealand

Posted 15 July 2014 - 11:31 AM

View Postlogsys, on 15 July 2014 - 11:02 AM, said:

Sugestion: Read-only drives... Also, run from website.. So, just like OneOS(I think it needs more space), it could run the ramdisk from the web and the OS would use those files within the read-only drive

That'd actually be pretty cool. Although downloading 400-600KB could be rather slow...

#18 Mr. Bateman

  • Members
  • 98 posts
  • LocationAustralia

Posted 15 July 2014 - 11:41 AM

View Postlogsys, on 15 July 2014 - 11:21 AM, said:

Do you see pastebin run <blahblahblah>?? doing like ramdisk load <link> would create a ramdisk without having to save a current ramdisk
Oh, I see now. Compression might be needed though.

View Postoeed, on 15 July 2014 - 11:31 AM, said:

That'd actually be pretty cool. Although downloading 400-600KB could be rather slow...
I've been playing with a RAID implementation in CC, and I don't think the ability to split drives into chunks and download those simultaneously would be hard to help the speed, if it does at all.

#19 oeed

    Oversimplifier

  • Members
  • 2,095 posts
  • LocationAuckland, New Zealand

Posted 15 July 2014 - 12:01 PM

View PostROFLCopter64bit, on 15 July 2014 - 11:41 AM, said:

View Postoeed, on 15 July 2014 - 11:31 AM, said:

That'd actually be pretty cool. Although downloading 400-600KB could be rather slow...
I've been playing with a RAID implementation in CC, and I don't think the ability to split drives into chunks and download those simultaneously would be hard to help the speed, if it does at all.

Well, in terms of 'streaming' a program, you'd have to wait until all chunks were downloaded, otherwise you'd have files that don't exist. RAID in CC sounds pretty awesome, it would allow data centres for Firefolf/similar services.

#20 Mr. Bateman

  • Members
  • 98 posts
  • LocationAustralia

Posted 15 July 2014 - 12:21 PM

View Postoeed, on 15 July 2014 - 12:01 PM, said:

RAID in CC sounds pretty awesome, it would allow data centres for Firefolf/similar services.
Would RAID 5/6 be needed in in this situation? My RAID 0 is just a hack of union points which hides the true location of the directories, and RAID 1 technically just hides one drive, then takes all the input from the other drive and mirror it.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users