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

Change-Id: I0b568ff4063cb516352024333cb31bc4cd96941f