}
}
// Suffix the path with the parallel instance index, if needed
this.actualFilePath = (numTasks > 1 || outputDirectoryMode == OutputDirectoryMode.ALWAYS) ? p.suffix("/" + (taskNumber+1)) : p;
// create output file
this.stream = fs.create(this.actualFilePath, writeMode == WriteMode.OVERWRITE);
// at this point, the file creation must have succeeded, or an exception has been thrown