#include<stdio.h>
#include<stdlib.h>
#include<stdint.h> 
#include<stddef.h>
#include<string.h>
char pathname[256] = {"ins.txt"};
int main()
{//0xb7,0x59,0x01,0x03,0x2a,0x00,

     int  buf_len = 0;
     char* buf = NULL;
     FILE *fp = NULL;
     int  len = 0;
     
     fp = fopen(pathname, "a+");   
     if (!fp) {
       
        return 0;
     }

     fseek(fp, 0, SEEK_END);
     len = ftell(fp);
   
     fseek(fp,0,SEEK_SET);//file head
     fwrite("2024", 1, 4, fp);fseek(fp,0,SEEK_SET);//file head
     buf = malloc(len + 1);

     if(buf == NULL){
        buf = (char *)malloc(len + 1);
        if(buf == NULL){
           
             return 0;
        }
     }
      
     memset(buf, 0, len+1);
     buf_len = fread(buf, 1, len, fp);
 
     fclose(fp);
     
   
     if(buf_len > 0){
        printf("\n_init_json_from_config_file cJSON_Parse:[%s]\n", buf);
       
     }
  
  return 0;
}
