@Test public void testStat() throws IOException{ if(!isUnix()) return; Unix.stat st = new Unix.stat(); int result; result = Unix.stat("/XXXXXXX", st); assertEquals(result, -1); assertEquals(Unix.errno(), Unix.ENOENT); result = Unix.stat("/tmp", st); assertTrue(st.st_atime != 0); assertTrue(Unix.S_ISDIR(st.st_mode)); File tempFile = File.createTempFile("jpathwatch-stattest", "tst"); Unix.stat st1 = new Unix.stat(); result = Unix.stat(tempFile.getPath(), st1); FileOutputStream fos = new FileOutputStream(tempFile); fos.write(1); fos.close(); Unix.stat st2 = new Unix.stat(); result = Unix.stat(tempFile.getPath(), st2); assertNotSame(st1, st2); }
native static int stat(String path, stat st);
Unix { native static int stat(String path, stat st); }
Unix { native static int stat(String path, stat st);  }
Unix { native static int stat(String path, stat st);   }
Unix { native static int stat(String path, stat st);    }