Author Topic: Reading binary files with pointers instead of returned char stream?  (Read 2966 times)

mindslight

  • Administrator
  • Full Member
  • *****
  • Posts: 157
  • Karma: +6/-1
    • View Profile
    • Jo Engine
Re: Reading binary files with pointers instead of returned char stream?
« Reply #15 on: February 20, 2018, 06:04:49 pm »
This function can be easily optimized.

Let me look at my side before you rewrite your own function  ;)

mindslight

  • Administrator
  • Full Member
  • *****
  • Posts: 157
  • Karma: +6/-1
    • View Profile
    • Jo Engine
Re: Reading binary files with pointers instead of returned char stream?
« Reply #16 on: February 20, 2018, 06:27:49 pm »
Done.

You can pull from GIT

Code: [Select]
/** @brief Set how many sector is read on the same time
 *  @param count Sector count
 */
void            jo_fs_set_read_sector_count(const int count);

Restriction: don't change read size if a file is being read  ;)

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Reading binary files with pointers instead of returned char stream?
« Reply #17 on: February 20, 2018, 06:36:30 pm »
Wow, that was fast!

If the nb of bytes remaining to be read is less than the sector count, will it get past that point or does it ajust accordingly?

I say that because I need to split where the data goes since my files are larger than the available RAM and reading past the limit will break everything up.

EDIT : I did a quick test, and as I suspected there is no "safety net". I guess the way around this is to check if the remaining number of bytes to be read is less than the sector count, then switch to reading one sector at a time.
« Last Edit: February 20, 2018, 06:48:06 pm by XL2 »

mindslight

  • Administrator
  • Full Member
  • *****
  • Posts: 157
  • Karma: +6/-1
    • View Profile
    • Jo Engine
Re: Reading binary files with pointers instead of returned char stream?
« Reply #18 on: February 20, 2018, 06:55:49 pm »
I have an idea :)

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: Reading binary files with pointers instead of returned char stream?
« Reply #19 on: February 23, 2018, 04:59:33 pm »
On a sidenote, the loading is super slow, but it's also prone to failures.
I'm not sure why, but ever since Jo Engine was updated with the read retry functions I had multiple failures while loading.
Any ideas how to both make it faster to load and more reliable?

 

Sitemap 1 2 3 4 5 6 7 8 9 10 
SMF spam blocked by CleanTalk