[Solved] Two streams and one file

It depends on your operating system. On Windows the new FileOutputStream(…) will probably fail. On Unix-line systems you will get a new file while the old one continues to be readable. However your copy loop is invalid. available() is not a test for end of stream, and it’s not much use for other purposes either. … Read more

[Solved] Java realtime writing file when it’s opened

Interesting: Lets deal this in simple way. 1. Save a file test.txt somewhere. 2. Open that file and keep it opened In Java write to this file (Standard Code) FileWriter fw = new FileWriter(new FileOutputStream(new File(“c:/test.txt”))); fw.write(“ABC”) Now go to notepad file again. I normally used Textpad it does refresh automatically (by an alert) because … Read more