jdk/src/windows/classes/sun/nio/fs/WindowsChannelFactory.java
changeset 7515 43202796198e
parent 5506 202f599c92aa
child 7668 d4a77089c587
equal deleted inserted replaced
7298:895772293d6e 7515:43202796198e
   155             throw new IllegalArgumentException("READ + APPEND not allowed");
   155             throw new IllegalArgumentException("READ + APPEND not allowed");
   156         if (flags.append && flags.truncateExisting)
   156         if (flags.append && flags.truncateExisting)
   157             throw new IllegalArgumentException("APPEND + TRUNCATE_EXISTING not allowed");
   157             throw new IllegalArgumentException("APPEND + TRUNCATE_EXISTING not allowed");
   158 
   158 
   159         FileDescriptor fdObj = open(pathForWindows, pathToCheck, flags, pSecurityDescriptor);
   159         FileDescriptor fdObj = open(pathForWindows, pathToCheck, flags, pSecurityDescriptor);
   160         return FileChannelImpl.open(fdObj, flags.read, flags.write, null);
   160         return FileChannelImpl.open(fdObj, flags.read, flags.write, flags.append, null);
   161     }
   161     }
   162 
   162 
   163     /**
   163     /**
   164      * Open/creates file, returning AsynchronousFileChannel to access the file
   164      * Open/creates file, returning AsynchronousFileChannel to access the file
   165      *
   165      *
   228         // map options
   228         // map options
   229         int dwDesiredAccess = 0;
   229         int dwDesiredAccess = 0;
   230         if (flags.read)
   230         if (flags.read)
   231             dwDesiredAccess |= GENERIC_READ;
   231             dwDesiredAccess |= GENERIC_READ;
   232         if (flags.write)
   232         if (flags.write)
   233             dwDesiredAccess |= (flags.append) ? FILE_APPEND_DATA : GENERIC_WRITE;
   233             dwDesiredAccess |= GENERIC_WRITE;
   234 
   234 
   235         int dwShareMode = 0;
   235         int dwShareMode = 0;
   236         if (flags.shareRead)
   236         if (flags.shareRead)
   237             dwShareMode |= FILE_SHARE_READ;
   237             dwShareMode |= FILE_SHARE_READ;
   238         if (flags.shareWrite)
   238         if (flags.shareWrite)