I am trying to read some text from a file and write it to another using open(), read() and write().
open()
read()
write()
This is my open()
Reading http://linux.die.net/man/2/open it seems you missed the mode parameter for open:
mode
mode must be specified when O_CREAT is in the flags, and is ignored otherwise. The argument mode specifies the permissions to use in case a new file is created.