0 Replies Latest reply: Apr 9, 2009 7:11 AM by 843829 RSS

    JVM and fsync (UNIX)

    843829
      I have some code like this:
      OutputStream os = ...
      ...
      os.flush();
      os.getFD().sync();
      os.close();
      Now I'd like to be sure that the content is written to disk. Normally I'd strace the programm and look for the fsync call but for some reason that didn't work. I also tried a
      Runtime.getRuntime().exec("sync");
      but again, strace didn't show any fsync calls.

      So my question is: how can I make sure that a call to a FileDescriptor's sync-method calls the fsync system call?