Added fopen function.