Hi,
I'm using File.createTempFile to create regular files I want to keep, the reason I use this method is because it guarantees a unique file name. However I'm seeing a strange thing with files created by this method: After I flush and closed the output stream on this file, I crash the machine running JVM deliberately, I assumed since the stream is flushed and closed, the file should contain valid data. However, sometimes the file gets filled with 0x0 instead (Note I'm testing this on a VMWare box running WinXP and latest Sun JVM 1.6).
Is the problem caused by the temp file or is this some kind of general problem which applies to all Java file io? What should I do to ensure the data gets flushed to harddrive?
Thanks