Is there some easy way to check whether or not a file exists? As far as I can tell, the best way to do it (without using an exec()) is to try to open it to read from it and let it throw an exception.
What I want to be able to do is, if a user tries to create a file names MrFile.txt, and it already exists, to make it MrFile_1.txt, if that exists, make it MrFile_2.txt, etc. until it finds one. Is there some easy way to do that?
Thanks!
-iago
I believe File.exists()...