add fopen and fclose in native.c