Skip to content
Permalink
Browse files
Troubleshooting
  • Loading branch information
leerho committed Nov 8, 2018
1 parent aa54d32 commit 6f1024d1f07aeac034234b7ed95a5f94995c56b3
Showing 2 changed files with 8 additions and 3 deletions.
@@ -255,7 +255,13 @@ static boolean isFileReadOnly(final File file) {
bits |= ((permissions.contains(PosixFilePermission.OTHERS_WRITE)) ? 1 << 1 : 0);
bits |= ((permissions.contains(PosixFilePermission.OTHERS_EXECUTE)) ? 1 : 0);
// Here we are going to ignore the Owner Write & Execute bits to allow root/owner testing.
//System.err.println(file.getName() + " : " + Integer.toBinaryString(bits));
final String filename = file.getName();
System.err.println(filename + " : " + Integer.toBinaryString(bits));
if ((filename == "GettysburgAddress.txt") && (bits == 436)) {
for (StackTraceElement ste : Thread.currentThread().getStackTrace()) {
System.err.println(ste);
}
}
return ((bits & 0477) == 0444);
}

@@ -129,8 +129,7 @@ public void testMapException() throws IOException {
public void simpleMap2() throws IOException {
File file =
new File(getClass().getClassLoader().getResource("GettysburgAddress.txt").getFile());
boolean ro = isFileReadOnly(file);
assertTrue(ro);
assertTrue(isFileReadOnly(file));
try (WritableMapHandle rh = WritableMemory.map(file)) {
//
}

0 comments on commit 6f1024d

Please sign in to comment.