0

i want to create a directory in the memory and after a few days of googling i found that using tmpfs is one of ways to do that, please if any one knows how to create directories using tmpfs and java. here's what i'm using to create directory in the system.

File currentFolder = new File( "path" );
    File workingFolder = new File( currentFolder, "serialized" );
    if ( !workingFolder.exists() ) {
        workingFolder.mkdir();
    }
    System.out.println( workingFolder.getAbsolutePath() );
toto totto
  • 65
  • 2
  • 10
  • tmpfs (linux) is a file system so you need to mount a tmpfs partition with system command. After you will be able to create a directory within. – Mr_Thorynque Dec 16 '15 at 08:47
  • yes you're right, do you know an way to store directories in the memory?? – toto totto Dec 16 '15 at 08:50
  • If you use linux tmpfs is a good way, usually /tmp is mount over tmpfs filesysteme. On windows you need a tool like RAMDisk to create a directory in ram. – Mr_Thorynque Dec 16 '15 at 09:35
  • thanks for the these answers but how matter the OS used, what i want exactly is to create this folder in the memory and this this folder must be deleted automatiquelly – toto totto Dec 16 '15 at 09:42

0 Answers0