Should it be checking if srcfile != dstfile instead?