logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Muller" <...@online.no>
Subject RE: File locking in FileAppender
Date Mon, 14 Jul 2003 12:17:56 GMT
Milin,

| Thanks for the quick response.  I don't see anything specifically
| written about file locking in the java.io.Writer.

Of course not. java.io.Writer is a generic (abstract) character emitter and
leaves the media specifics to the subclasses, such as FileWriter. I wanted
to draw your attention to how it enforces synchronization across concurrent
calls to the write operation, since you asked how WriterAppender implemented
concurrency control.

| FileOutputStream javadocs does say that
|     "Some platforms, in particular, allow a file to be opened for
| writing by only one FileOutputStream
|     (or other file-writing object) at a time. In such situations
| the constructors in this class will fail if the file
|     involved is already open."
|
| On Windows I can definitely open the same file for writing in 2
| processes.  There is no failure in the constructor.  So
| should I assume that there is no file locking on Windows?

No, but you can assume that the OS controls concurrent writes internally.

|  The
| "write" method is native as you said, but there is no
| documentation on the implementation.

Which is according to java's intention of being as close to platform
independent as possible.

--

Thomas





*************************************************************************
Copyright ERA Technology Ltd. 2003. (www.era.co.uk). All rights reserved. 
The information supplied in this Commercial Communication should be treated
in confidence.
No liability whatsoever is accepted for any loss or damage 
suffered as a result of accessing this message or any attachments.

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Mime
View raw message