EremusOne / ESPectrum

A ZX spectrum 48K, 128K and Pentagon 128 emulator running on the Espressif ESP32 SoC
https://zxespectrum.speccy.org
GNU General Public License v3.0
162 stars 21 forks source link

Reading names of too many files in dirs failed #46

Closed s-e-r-g closed 1 month ago

s-e-r-g commented 2 months ago

I have zip archives with several folders (Games, Music, Demos, Magazines, etc...) and a lot of files in each (61000+, 3000+, ...) When reading these unpacked folders with 61000+ file names emulator crashes and restarts. I understand the problem - no space in RAM for all of them but maybe we could calc amount, and then read names by pages. Also what do you think about zip support? Does it make a sense ?

EremusOne commented 2 months ago

Hi!

As you said, RAM consumption is a problem: there's not too many available so we developed a system to sort folders using as low RAM as possible (it sorts folder names in chunks and later it combines the chunks in one only index file). It should support any number of files and we tested it with folders with up to 4000 files. Whilst long to index, it worked ok but 61000+ file names in a folder is not a good idea so I suggest you to organize files in less populated folders.

I don't consider necessary zip support right now because there are some more urgent features to add. Maybe in the future, when all those features are finished.

Regards ;)