use copy2 for copying files