tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Rotating catalina.out with Webmin
Date Mon, 15 Nov 2004 22:41:02 GMT
On Mon, Nov 15, 2004 at 03:39:01PM -0600, Filip Hanik - Dev wrote:
> this was not the case when using a, so I assume you tried
and verified this :)

	You are confused.  It _is_ the case with FileOutputStream.  The only
way it could be otherwise is if the output stream re-opens the file, either
on every write, or when it notices that the file name no longer refers to
the same file.

Create with this code:

public class aa
    public static void main(String[] args) throws Exception
        FileOutputStream f = new FileOutputStream(args[0]);
        f.write(80); f.flush();
        synchronized(f) { f.wait(5 * 1000); }
        f.write(81); f.flush();

And run this:
java aa foo &
mv foo bar

Notice that the output of the second write (which occurs after the file
is renamed) is in the original file (bar), not in a new foo.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message