@ Nonnegative public static int fsyncRecursive ( final Path root ) throws IOException { final FsyncingSimpleFileVisitor visitor = new FsyncingSimpleFileVisitor ( ) ; Files . walkFileTree ( root , visitor ) ; return visitor . getFileCount ( ) ; }
Walk a directory tree and Fsync both Directory and File inodes . This does NOT follow symlinks and does not attempt to fsync anything other than Directory or NormalFiles .