java - How to run a process from memory/RAM as the "current working directory" -
in java 6 on windows, interested in performing following task, not sure how go it.
- i want take zip file
- unzip contents spot in memory/ram
- create java process run .exe file exists within zip file
- that .exe must run while current working directory location in ram
- i need put file same "current working directory" location space in ram.
i know sounds weird, make more efficient doing way, if possible, great know.
it sounds difficult, , require lot of stuff cannot done in pure java.
on linux, think need following:
create , mount "tmpfs" - https://unix.stackexchange.com/questions/66329/creating-a-ram-disk-on-linux
unzip zip file tmpfs
run .exe using processbuilder ... allows set child processes current directory.
etcetera
unmount "tmpfs" when you've done.
the commands creating "ram disk" file system os specific, , may require root / administrator privilege.
it unclear whether doing more efficient using temporary directory in file system. wouldn't attempt unless there demonstrated need solution more efficient; i.e. unless you've tried using temporary directory , found slow.
bear in mind that:
much (maybe most) of work of unpacking zip file has done either way it, and
in conventional case .exe probably reading files expanded zip out of os'es in-memory disk-block cache (on linux).
Comments
Post a Comment