@Override
  public List<SpawnResult> writeOutputToFile(
      AbstractAction action,
      ActionExecutionContext actionExecutionContext,
      DeterministicWriter deterministicWriter,
      boolean makeExecutable, boolean isRemotable)
      throws ExecException {
    Path outputPath =
        actionExecutionContext.getInputPath(Iterables.getOnlyElement(action.getOutputs()));
    // TODO(ulfjack): Consider acquiring local resources here before trying to write the file.
    try (AutoProfiler p =
        AutoProfiler.logged(
            "running write for action " + action.prettyPrint(),
            logger,
            /*minTimeForLoggingInMilliseconds=*/ 100)) {
      try {
        try (OutputStream out = new BufferedOutputStream(outputPath.getOutputStream())) {
          deterministicWriter.writeOutputFile(out);
        }
        if (makeExecutable) {
          outputPath.setExecutable(true);
        }
      } catch (IOException e) {
        throw new EnvironmentalExecException("IOException during file write", e);
      }
    }
    return ImmutableList.of();
  }
@Override
  public List<SpawnResult> writeOutputToFile(
      AbstractAction action,
      ActionExecutionContext actionExecutionContext,
      DeterministicWriter deterministicWriter,
      boolean makeExecutable, boolean isRemotable)
      throws ExecException {
    Path outputPath =
        actionExecutionContext.getInputPath(Iterables.getOnlyElement(action.getOutputs()));
   
    try (AutoProfiler p =
        AutoProfiler.logged(
            "running write for action " + action.prettyPrint(),
            logger,
            100)) {
      try {
        try (OutputStream out = new BufferedOutputStream(outputPath.getOutputStream())) {
          deterministicWriter.writeOutputFile(out);
        }
        if (makeExecutable) {
          outputPath.setExecutable(true);
        }
      } catch (IOException e) {
        throw new EnvironmentalExecException("IOException during file write", e);
      }
    }
    return ImmutableList.of();
  }
@override public list<spawnresult> writeoutputtofile( abstractaction action, actionexecutioncontext actionexecutioncontext, deterministicwriter deterministicwriter, boolean makeexecutable, boolean isremotable) throws execexception { path outputpath = actionexecutioncontext.getinputpath(iterables.getonlyelement(action.getoutputs())); try (autoprofiler p = autoprofiler.logged( "running write for action " + action.prettyprint(), logger, 100)) { try { try (outputstream out = new bufferedoutputstream(outputpath.getoutputstream())) { deterministicwriter.writeoutputfile(out); } if (makeexecutable) { outputpath.setexecutable(true); } } catch (ioexception e) { throw new environmentalexecexception("ioexception during file write", e); } } return immutablelist.of(); }