0

How to write a text file to dRAM? No disk writes.

With Ubuntu 20.04 Terminal or Command Line Interface (CLI) ...
It is required to use RAM or dRAM (Dynamic ram) as a scratch pad.

A scratch pad is for temporary data.
A scratch pad means no writing files to disk.
No writing to disk means no writing to a SDD, HDD or even a RAM disk.
Only writing to RAM also known as dRAM.

Below file1 is a text file written to disk.
file1 is compared with file2 to show difference.
Show missing directories.
How to do this all in dRAM? No disk writes.

dir1='/media/user/usb/TEMP/' ;
dir2='/home/user/Desktop/TEMP/' ;

find $dir1 -type d -printf "%P\n" | sort > file1 ; find $dir2 -type d -printf "%P\n" | sort | diff - file1 ;

Again, How to do above all in dRAM with CLI? No disk writes.

joseph
  • 1
  • 1
  • https://www.thegeekstuff.com/2008/11/overview-of-ramfs-and-tmpfs-on-linux/ – Frank Thomas Oct 07 '21 at 04:44
  • "Only writing to RAM" that's what a RAM disk is. "also known as dRAM" literally the first time I've heard of this definition in 15 years. RAM is RAM. It doesn't matter how you use it, it's still the same RAM. – u1686_grawity Oct 07 '21 at 05:13
  • RAM disk is not portable. Looking for a portable solution. Link stated above mentions possible portable solutions like /tmp and /var/tmp (for data that should persist across reboots) and /dev/shm and $TMPDIR. – joseph Oct 07 '21 at 06:52
  • 2
    You need to [edit] your question to explain why a ramdisk is not an option and why you consider it "not portable". As it stands either you are misunderstanding the difference between RAM and DRAM or there is some key information that you are not giving that explains your problem and its requirements. – Mokubai Oct 07 '21 at 08:55

0 Answers0