Skip to main content
2 of 2
CPlus
  • 1.2k
  • 2
  • 13
  • 36

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