Name: stC104175 Date: 05/17/2000
java version "1.3.0"
Java (TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot (TM) Client VM (build 1.3.0-C, mixed mode)
Write files to an almost full floppy disk. Files will be properly written until
floppy disk is full. After that _no_ exception is thrown that the disk is full,
but empty files of 0KB are written to floppy until name-table fills up. Then an
exception is thrown.
public class SimplCon {
public SimplCon () {
}
static public void main(String args[]) {
try {
String filename = "a:\\file";
File f;
for (int i = 0; ; i++) {
f = new File(filename + i + ".txt");
FileOutputStream fos = new FileOutputStream(f);
PrintWriter w = new PrintWriter(new OutputStreamWriter(fos));
String text = "blah blah blah blah blah blah blah blah";
w.print(text);
w.flush();
fos.flush();
fos.close();
w.close();
}
} catch (Exception e) {
System.err.println(e.getMessage());
e.printStackTrace(new PrintStream(System.err));
}
}
}
(Review ID: 104951)
======================================================================
java version "1.3.0"
Java (TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot (TM) Client VM (build 1.3.0-C, mixed mode)
Write files to an almost full floppy disk. Files will be properly written until
floppy disk is full. After that _no_ exception is thrown that the disk is full,
but empty files of 0KB are written to floppy until name-table fills up. Then an
exception is thrown.
public class SimplCon {
public SimplCon () {
}
static public void main(String args[]) {
try {
String filename = "a:\\file";
File f;
for (int i = 0; ; i++) {
f = new File(filename + i + ".txt");
FileOutputStream fos = new FileOutputStream(f);
PrintWriter w = new PrintWriter(new OutputStreamWriter(fos));
String text = "blah blah blah blah blah blah blah blah";
w.print(text);
w.flush();
fos.flush();
fos.close();
w.close();
}
} catch (Exception e) {
System.err.println(e.getMessage());
e.printStackTrace(new PrintStream(System.err));
}
}
}
(Review ID: 104951)
======================================================================