I did ask around in the forums and I thought letting the "dataDir" directory to point to "/dev/null" would solve the problem. But being a (ahem) Windows user I couldn't quite get the "/dev/null" to work. In Windows the equivalent is "nul" but it doesn't quite work when you try to use it from Java. Some operations work, but some don't.
[Update 1:
Strangely
getAbsolutePath()
prepends the current directory's path but the file does not get created.Creating
nul:\abc.log
throws an exception. But nul:abc.log
does not and Java says its absolute path is d:\dump\nul:abc.log
but the file is not there. Which means that it is indeed writing to the "null" device. I wonder what I'm missing.]
As usual, the full code is here: http://gist.github.com/484116
Here's the output and it shows what works and what doesn't:
I think the Windows null device name is NUL:
ReplyDeleteNot D:\somedir\nul:
Just NUL:
Like C: D: etc.
Similarly the console device in Windows is CON:
Yup, that's what I did in very the first line but Java new File("nul:").getAbsolutePath() mysteriously adds a prefix to it.
ReplyDeleteLooks like a bug in the java.io.File implementation. Would suggest file a bug on the JDK: http://bugreport.sun.com/bugreport/
ReplyDeletejava.io.File depends on an abstract class called FileSystem, which is implemented as a native library.
I've filed a bug report. Waiting for a confirmation from Oracle.
ReplyDeleteHi did you get solution of your problem?
ReplyDelete@Amit - no luck
ReplyDelete