Sure, you can make that criticism. But if you think about it, when you read the files in directory order, as long as you don't sort the files, you'll get them in the order they were created. Therefore, appending a random number is a perfectly acceptable method of generating the unique file names. Except for the small possibility of getting the same filename...