Lines Matching defs:file
698 FILE *file = fopen(image_path, "rb+");
699 if (!file) {
703 fseek(file, offset, SEEK_SET);
704 if (offset != ftell(file)) {
708 if (!fwrite(data, blocks * BLOCK_SIZE, 1, file)) {
714 if (file) {
715 fclose(file);
723 FILE *file = fopen(image_path, "rb");
724 if (!file) {
728 fseek(file, offset, SEEK_SET);
729 if (offset != ftell(file)) {
732 if (!fread(data, blocks * BLOCK_SIZE, 1, file)) {
737 if (file) {
738 fclose(file);
802 FILE *file = fopen(path, "wb");
803 if (!file) {
806 fwrite(data, len, 1, file);
807 fclose(file);
1110 /**********************append file************************/
1199 LOGE("No file to pack!");
1241 static bool dump_file(FILE *file, const char *unpack_dir, index_tbl_entry entry)
1253 pos = ftell(file);
1262 fseek(file, offset, SEEK_SET);
1263 if (offset != ftell(file)) {
1272 if (!fread(buf, n, 1, file)) {
1289 fseek(file, pos, SEEK_SET);
1392 LOGD("try to write file(%s) to offset:%d...", src_path, offset_block);