Program to simulate fopen