mannyzhou5 / evolutionchamber

Automatically exported from code.google.com/p/evolutionchamber
0 stars 0 forks source link

Possible issue with seed files #116

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The two seed files don't appear to be saved to the correct location, but I 
could be wrong :).  They are saved in the current working directory under the 
"etc" folder.  But according to EcFileSystem, it looks like they are meant to 
be saved in the OS's temporary directory.  Also, it looks like "etc" is 
supposed to be deleted when the program terminates, but it is in fact not 
deleted (because it is in the wrong place).  I think that these changes need to 
be made:

In EvolutionChamber.java:

static 
{
    SEEDS_EVO = new File(EcFileSystem.getTempPath(), "seeds.evo");
    SEEDS_EVO_2 = new File(EcFileSystem.getTempPath(), "seeds2.evo");
}

In EcFileSystem.java:

public class EcFileSystem
{
    public static String getTempPath()
    {
        return createTempDirectory().getAbsolutePath();
    }

    private static File createTempDirectory() {
        File tempFolder = new File(System.getProperty("java.io.tmpdir"));
        File createTempFile = new File(tempFolder,"etc");
        createTempFile.mkdir();
        createTempFile.deleteOnExit();
        return createTempFile;
    }
}

Original issue reported on code.google.com by mike.angstadt on 5 Nov 2010 at 8:46

GoogleCodeExporter commented 9 years ago
Etc is not supposed to be deleted, this is just to get the 'etc' directory 
established.

Original comment by Frit...@gmail.com on 6 Nov 2010 at 1:43

GoogleCodeExporter commented 9 years ago
Ok, then it looks like the entire EcFileSystem.createTempDirectory() method is 
unnecessary :).  All this method does is create a folder inside of the OS's 
temp directory, which is never used.  In fact, you could probably get rid of 
the entire class.

Original comment by mike.angstadt on 6 Nov 2010 at 2:17