Support absolute path for `dest`

A more neat implementation and test, thanks for advice from @milang.