It looks like we need a better way to identify if the destination is a directory or a file. Perhaps the best way is to add a new optional argument for filename, and make destination always a directory. Note that this would likely require changes in downstream consumers.