flash_file.c 560 B

1234567891011121314151617181920
  1. #include <stdio.h>
  2. //#include <io.h>
  3. //#include <fcntl.h>
  4. //#include <sys/stat.h>
  5. #include "flash.h"
  6. int file_handle;
  7. int FLASH_SIZE;
  8. int flash_file_init(void)
  9. {
  10. // file_handle = open(FILE_NAME, O_RDWR |O_BINARY| O_CREAT, S_IREAD | S_IWRITE);
  11. // if(file_handle >= 0) {
  12. // printf("read file ok\n");
  13. // } else {
  14. // printf("read file error\n");
  15. // return -1;
  16. // }
  17. // FLASH_SIZE = lseek(file_handle, 0, SEEK_END) ;// / BLOCK_SIZE * BLOCK_SIZE; /*È¡ÕûÊý*/
  18. // printf("the size of jffs bin file is %d", FLASH_SIZE);
  19. return 0;
  20. }