Writes every file of pkg under into, replacing whatever that directory held before.
the package to write
target directory, created if missing
if the files cannot be written
if a file's content cannot be downloaded