add fread and fwrite