Open bwoebi opened 8 months ago
This would likely mean two functions:
tempfile_with_prefix
tempfile_with_prefix_in
It's not truly cross-platform as the prefix would make no sense on Linux, but I'm open to it as long as we document that fact. As you say, this is only for debugging anyways.
I'll also chime in here with a use case; I'm using a tempfile to hold downloaded data that's then processed by an external tool, wiping the file/data after it's done. The problem is that the external tool does detection based on the file's suffix, so I have to lose FILE_FLAG_DELETE_ON_CLOSE (or as a workaround use a common filename in a temp dir).
It would be great it if it were possible to have some API where I can pass a prefix / name ending up with a self-deleting temp file.
I suppose for most use cases this doesn't matter, but I tried to use a well-known prefix, for two reasons:
a) finding the file in Resource Monitor for debugging b) naming a temporary executable so that it can be trivially identified in task manager.