Yes, but a function called purge_dir shouldn't delete the directory. The function should either be named remove_dir or the call to purge_dir should handle removing the directory after it's called.