publicclass ManyFiles { staticint count; static List files = new ArrayList(); static List streams = new ArrayList(); staticint NUM_FILES = 2050;
publicstaticvoid main(String args[]) throws Exception { // Linux does not yet allow opening this many files; Solaris // 8 requires an explicit allocation of more file descriptors // to succeed. Since this test is written to check for a // Windows capability it is much simpler to only run it // on that platform.
String osName = System.getProperty("os.name"); if (osName.startsWith("Linux")) return;
for (int n = 0; n < NUM_FILES; n++) {
File f = new File("file" + count++);
files.add(f);
streams.add(new FileOutputStream(f));
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.