utils: cp; fix write syscall