src/java.base/windows/classes/sun/nio/fs/WindowsChannelFactory.java
Print this page
rev 10764 : 8023173: FileDescriptor should remember its append mode [win]
*** 158,168 ****
throw new IllegalArgumentException("READ + APPEND not allowed");
if (flags.append && flags.truncateExisting)
throw new IllegalArgumentException("APPEND + TRUNCATE_EXISTING not allowed");
FileDescriptor fdObj = open(pathForWindows, pathToCheck, flags, pSecurityDescriptor);
! return FileChannelImpl.open(fdObj, pathForWindows, flags.read, flags.write, flags.append, null);
}
/**
* Open/creates file, returning AsynchronousFileChannel to access the file
*
--- 158,168 ----
throw new IllegalArgumentException("READ + APPEND not allowed");
if (flags.append && flags.truncateExisting)
throw new IllegalArgumentException("APPEND + TRUNCATE_EXISTING not allowed");
FileDescriptor fdObj = open(pathForWindows, pathToCheck, flags, pSecurityDescriptor);
! return FileChannelImpl.open(fdObj, pathForWindows, flags.read, flags.write, null);
}
/**
* Open/creates file, returning AsynchronousFileChannel to access the file
*
*** 337,344 ****
--- 337,345 ----
}
// create FileDescriptor and return
FileDescriptor fdObj = new FileDescriptor();
fdAccess.setHandle(fdObj, handle);
+ fdAccess.setAppend(fdObj, flags.append);
return fdObj;
}
}