Thanks, steph_bow! For some reason I didn't see your post until after I posted the solution you had already come up with. Yes, because I didn't add the $file variable to my output file, the second unique file was never created. Now it does! I posted my final code in another reply... I think because I'm anonymous or something I don't get to see the whole thread or something? Means I should register, eh? Thanks, everyone, you've been very helpful!