O
Oz Levanon
Hi.
I have a java program running on linux (Redhat 9, Java 1.4.2, build
1.4.2-b28).
The program periodically accesses a file on the hard disk using the
following code:
FileOutputStream fos = new FileOutputStream(filename);
PrintWriter pw = new PrintWriter(fos);
// ...
// writes stuff to the file.
// ...
pw.close();
fos.close();
Every now and then (sometimes after hundreds of times, sometimes after
less) the program hands. I can see from debug prints I've added that
it is stuck after the new FileOutputStream(filename) and before the
new PrintWriter(fos);
The program doesn't exit (and no throwable is thrown) but rather stays
up and running, but never gets past this line.
Does anyone have any idea what could cause a program to hang in this
line? Can anything on linux be done to a file that will cause a
program trying to access it hang?
TIA, oz.
I have a java program running on linux (Redhat 9, Java 1.4.2, build
1.4.2-b28).
The program periodically accesses a file on the hard disk using the
following code:
FileOutputStream fos = new FileOutputStream(filename);
PrintWriter pw = new PrintWriter(fos);
// ...
// writes stuff to the file.
// ...
pw.close();
fos.close();
Every now and then (sometimes after hundreds of times, sometimes after
less) the program hands. I can see from debug prints I've added that
it is stuck after the new FileOutputStream(filename) and before the
new PrintWriter(fos);
The program doesn't exit (and no throwable is thrown) but rather stays
up and running, but never gets past this line.
Does anyone have any idea what could cause a program to hang in this
line? Can anything on linux be done to a file that will cause a
program trying to access it hang?
TIA, oz.