file_open_read()
file_open_write()
file_open_append()
file_exists()

Look these up in the manual, they should get you started...