Odi's astoundingly incomplete notes
New entries | CodeJava and its use of filesystem syscalls
File f = new File("build.xml"); // openat(AT_FDCWD, "build.xml", O_RDONLY) = 96 // fstat(96 InputStream io = new FileInputStream(f); // read(96 io.read(); // read(96 io.read(); // close(96) io.close(); Path p = f.toPath(); // openat(AT_FDCWD, "build.xml", O_RDONLY) = 96 io = Files.newInputStream(p); // read(96 io.read(); // read(96 io.read(); // close(96) io.close();The NIO way of creating an input stream from a file actually saves an
fstat
syscall.Add comment