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).
Merge pull request #39 from DerekRoth/patch-1

test if dest option is an existing file