init: use read_file and write_file to implement do_copy builtin
am: 67f6a530ba  -s ours

Change-Id: If7fb6ba612f16069bc139c03e682a059ba531358