This is wrong, I suppose, since this will overwrite the file with the same name. I'll look for a better solution