test if dest option is an existing file

When the dest option was used with an incorrect path, the generated files were written to the root folder of the filesystem (eg C:\ on windows).