I use logging in my application... The problem is that I am opening the PrintWri
JavaFAQ Home » General Java
Question: I use logging in my
application... The problem is that I am opening the
PrintWriter stream only once and keep it open until my application is stopped.
Open PrintWriter stream does not let to open logs in text editor and users can
not read logs...
Appears a error message like this: "Can not open file, it used by another
Is it possible to solve the problem?
Answer: It depends on OS type. For
example in Windows NT you can use command "type":
type log.txt > log_copy.txt and then read log_copy.txt file in any
In UNIX use command "cat":
cat log.txt > log_copy.txt
Printer Friendly Page
Send to a Friend
Search here again if you need more info!