func GetOutputFile()

in workload-management/s3-trigger-ecs-task/s3-file-processor/utils/FileHelper.go [141:160]


func GetOutputFile(overwrite bool) string {
	absoluteFileName := GetFileName(InputFilePath)
	dir := "/tmp/" + os.Getenv(StatusKey) + "/" + "Output"
	mkDirs(dir)
	outputPath := dir + "/" + absoluteFileName

	var err error
	if !overwrite {
		if _, err := os.Stat(outputPath); os.IsNotExist(err) {
			_, err = os.Create(outputPath)
		}
	} else {
		_, err = os.Create(outputPath)
	}

	if err != nil {
		log.Printf("Unable to open file " + err.Error())
	}
	return outputPath
}