static FileChannel newFileChannel(int dfd,UnixPath path,String pathForPermissionCheck,Set<? extends OpenOption> options,int mode) throws UnixException {
  Flags flags=Flags.toFlags(options);
  if (!flags.read && !flags.write) {
    if (flags.append) {
      flags.write=true;
    }
 else {
      flags.read=true;
    }
  }
  if (flags.read && flags.append)   throw new IllegalArgumentException("READ + APPEND not allowed");
  if (flags.append && flags.truncateExisting)   throw new IllegalArgumentException("APPEND + TRUNCATE_EXISTING not allowed");
  FileDescriptor fdObj=open(dfd,path,pathForPermissionCheck,flags,mode);
  return FileChannelImpl.open(fdObj,path.toString(),flags.read,flags.write,flags.append,null);
}

static FileChannel newFileChannel ( int dfd , UnixPath path , String pathForPermissionCheck , Set < ? extends OpenOption > options , int mode ) throws UnixException { Flags flags = Flags . toFlags ( options ) ; if ( ! flags . read && ! flags . write ) { if ( flags . append ) { flags . write = true ; } else { flags . read = true ; } } if ( flags . read && flags . append ) throw new IllegalArgumentException ( "READ + APPEND not allowed" ) ; if ( flags . append && flags . truncateExisting ) throw new IllegalArgumentException ( "APPEND + TRUNCATE_EXISTING not allowed" ) ; FileDescriptor fdObj = open ( dfd , path , pathForPermissionCheck , flags , mode ) ; return FileChannelImpl . open ( fdObj , path . toString ( ) , flags . read , flags . write , flags . append , null ) ; }
constructs a file channel by opening a file using a dfd / path pair
