Custom fopen, fclose fwrite and fread library