Update main.c

Replace fopen by open