copies a file or directory