Removed filecopy function in favor of a pair of read and write syscalls