I have a process that ingests a user-provided file and generates a new output based on a user-provided sample_id tag. However this can lead to the input and output files having the same name and this causes clobbering. I’m leery of renaming the input file because I don’t know how that would interact with cache and resume.
Is there a convenient way to ensure that an input file won’t clobber the output, perhaps by giving it some sort of permanent temporary filename or something like that?
Actually, I just realized my need is slightly more complex. The program I’m calling parses the filename extension to determine if the input is gzipped. I therefore would need to stage the file in a way that takes the given input name into account. For example if the user supplies input.txt.gz, then I’d like to stage it as something like “__temp__input.txt.gz”. Is this possible?