J2R5M3 / evolutionchamber

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

FileNotFoundException: c:\seeds.evo (Access denied) #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open a cmd line window (cmd.exe)
2. Run java -jar evolutionchamber-version-0002.jar
3. Enter any target and press start

What is the expected output? What do you see instead?
I expect the app to run and no exceptions to be raised in the cmd line window.

Instead the an exception is raised constantly in short intervals of time:
292828278732172998a42622226779222b302b7002222822026225bb643bbbb6b222529709187778
82374333java.io.FileNotFoundException: c:\seeds.evo (Odmowa dostŕpu)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at com.fray.evo.EvolutionChamber.saveSeeds(EvolutionChamber.java:261)
        at com.fray.evo.EvolutionChamber$1.geneticEventFired(EvolutionChamber.ja
va:149)
        at org.jgap.event.EventManager.fireGeneticEvent(EventManager.java:98)
        at org.jgap.impl.GABreeder.evolve(GABreeder.java:166)
        at org.jgap.Genotype.evolve(Genotype.java:225)
        at org.jgap.Genotype.run(Genotype.java:594)
        at java.lang.Thread.run(Unknown Source)

What version of the product are you using? On what operating system?

version 0002 on MS Windows Vista Home Premium SP2

java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b07)
Java HotSpot(TM) Client VM (build 17.0-b17, mixed mode, sharing)

Please provide any additional information below.
Since MS Windows Vista the C:\ drive defaults to read only for user 
applications. Since the C:\\seeds.evo and C:\\seeds2.evo paths are hard-coded 
as SEED_EVO and SEED_EVO2 on liens 35 and 36 of EvolutionChamber.java they will 
never get created and used on MS Windows Vista and MS Windows 7 (probably also 
on the newer versions of the OS).

This issue will probably also affect other operating system users (Linux, OS X) 
as the hard drives there are not denoted by letters and use a different 
directory separator.

I believe this issue may have a negative impact on performance (constantly 
raising exceptions and handling them is not cheap).

I suggest that the files are created either in the current working directory or 
a specified app directory dependent on the host operating system. For windows 
that would be %APPDATA% and the $HOME folder for Linux and OS X (not sure about 
the later one). Also any path separators should be handled differently on each 
operating system.

If my understanding of the code is correct, there is a lot of open/close 
operations on those files. I believe they should be opened once when the app 
starts and flushed periodically to the drive instead of constantly asking the 
OS for the file handle. This may increase the overall performance.

Original issue reported on code.google.com by netpr...@gmail.com on 18 Oct 2010 at 6:43

GoogleCodeExporter commented 8 years ago

Original comment by netpr...@gmail.com on 18 Oct 2010 at 8:12

GoogleCodeExporter commented 8 years ago
Fixed. Now will make an 'etc' directory in the current folder.

Original comment by Frit...@gmail.com on 18 Oct 2010 at 8:13

GoogleCodeExporter commented 8 years ago

Original comment by Frit...@gmail.com on 19 Oct 2010 at 12:07

GoogleCodeExporter commented 8 years ago

Original comment by netpr...@gmail.com on 22 Oct 2010 at 5:49