Autosave stats bugs (not triggered unless enable in config; throws FileSystemException: xxx: Is a directory)
Reported by UlyssesZh on GitHub
- Auto saving is not triggered unless I save the settings in a config file and load the config file on launch.
- Reports this error when it autosaves:
java.nio.file.FileSystemException: /home/ulysses/data/KeysPerSecond/stats: Is a directory
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219)
at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:478)
at java.base/java.nio.file.Files.newOutputStream(Files.java:220)
at java.base/java.nio.file.Files.newBufferedWriter(Files.java:2920)
at java.base/java.nio.file.Files.newBufferedWriter(Files.java:2963)
at dev.roanh.kps.Statistics.saveStats(Statistics.java:141)
at dev.roanh.kps.Statistics.lambda$saveStatsTask$0(Statistics.java:109)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Config file is like this:
statsSaving:
autoSave: true
autoDestination: /home/ulysses/data/KeysPerSecond/stats
autoFormat: 'md.kpsstats'
autoInterval: 1000
saveOnExit: true
loadOnLaunch: true
saveFile: /home/ulysses/data/KeysPerSecond/stats/md.kpsstats
Here /home/ulysses/data/KeysPerSecond/stats
is a dir. I expect it to autosave stats to the file /home/ulysses/data/KeysPerSecond/stats/md.kpsstats
. I don't know why it panics about the destination being a dir.
Tested on Linux with KPS 8.8.
Edited by Isla