There are actually many ways to do it as long as you are absolutely sure you have write permission to the directory.
one example is using http://www.php.net/rename
if its successful means the dir exist, else no. simple enough.
of course after renaming, u will have to rename to the original file name