0

In Java 6 on Windows, I am interested in performing the following task, but really not sure how to go about it.

  1. I want to take a zip file
  2. unzip its contents into a spot in memory/RAM
  3. Create a Java Process that will run a .EXE file that exists within that ZIP file
  4. That .EXE must be run while the current working directory is that location in the RAM
  5. I will then need to put another file into that same "current working directory" location space in the RAM.

I know it sounds weird, but it will actually make something much more efficient by doing it this way, so if its possible, it would be great to know.

E.S.
  • 2,733
  • 6
  • 36
  • 71

1 Answers1

0

It sounds difficult, and it will definitely require a lot of stuff that cannot be done in pure Java.

On Linux, I think you would need to do the following:

The commands for creating the "ram disk" file system will be OS specific, and may require root / administrator privilege.


It is unclear whether doing this will be more efficient than using a temporary directory in the file system. I wouldn't attempt this unless there was a clearly demonstrated need for a solution that it more efficient; i.e. unless you've tried using a temporary directory and found that it is too slow.

Bear in mind that:

  • much (maybe most) of the work of unpacking the ZIP file has to be done either way you do it, and

  • in the conventional case your .exe will probably be reading the files from the expanded ZIP out of the OS'es in-memory disk-block cache (on Linux).

Community
  • 1
  • 1
Stephen C
  • 698,415
  • 94
  • 811
  • 1,216