varlagas@yahoo.com wrote On 08/01/06 10:06,:
> Dear all,
>
[quoted text clipped - 10 lines]
>
> Is there any way to do this in Java?
Not that I know of. One technique that's often used
is to have A write to "output.tmp", say, and rename it to
"output.dat" when it has finished all its writing. That
way, B cannot even find the "output.dat" file while A is
still writing it.

Signature
Eric.Sosman@sun.com
tiewknvc9 - 01 Aug 2006 16:27 GMT
how about this.
Make another file called flag.txt
set the text of flag.txt text to "1" when the program is creating it,
then set the flag.txt text to "0" when it is done creating it.
Before process B reads the file, check its associated flag.
you can create many flag.txt files, you could simply use the
strNameOfTheFile + "flag.txt" as the unique flag.txt documents per
file.
let me know how it goes for you.
> varlagas@yahoo.com wrote On 08/01/06 10:06,:
> > Dear all,
[quoted text clipped - 17 lines]
> way, B cannot even find the "output.dat" file while A is
> still writing it.
EJP - 02 Aug 2006 02:03 GMT
> how about this.
>
[quoted text clipped - 32 lines]
>>way, B cannot even find the "output.dat" file while A is
>>still writing it.
I prefer the renaming method, but if you do the above you don't need the
0/1 contents of 'flag.txt', you can just check for its presence or absence.