C
christopher
Greetings!
This may be an OS thing, but FileWriter.write(Sting,int,int) thinks it
is writing ok when I remove the file it is writing to after the file
has been opened. No exception is thrown, because the line directly
after the write() and flush() within the try block is executed (I am
catching Exception if that matters). I am speculating that the OS is
not notifying the owner of the file handle (if I an saying it right)
that the file has been deleted / removed / whatever, and that this
might function differently on different systems.
I am trying to create a failover for a log writing thread, and I am
removing the file to simulate an IO error, hehe but that's not
working. Is there a) a better way to simulate an IO error? and b) a
more primitive write method that might throw an exception in this
unlikely circumstance?
Thanx!
clh
This may be an OS thing, but FileWriter.write(Sting,int,int) thinks it
is writing ok when I remove the file it is writing to after the file
has been opened. No exception is thrown, because the line directly
after the write() and flush() within the try block is executed (I am
catching Exception if that matters). I am speculating that the OS is
not notifying the owner of the file handle (if I an saying it right)
that the file has been deleted / removed / whatever, and that this
might function differently on different systems.
I am trying to create a failover for a log writing thread, and I am
removing the file to simulate an IO error, hehe but that's not
working. Is there a) a better way to simulate an IO error? and b) a
more primitive write method that might throw an exception in this
unlikely circumstance?
Thanx!
clh