Skip to main content
1 of 2

You can use tempnam(). It generates a filename that is guaranteed to be unique and not used in a given dir. It is atomic and so is free of any race conditions.