Lockup after file number is over 100

I am capturing data and saving to the SD card.
I open a file to append to, write the data, and then close the file.
repeatedly the ALFAT locks up at just over 100 files.
I can see the response time on the open command get longer.
and then it stops.
I just ran it again. There was already 103 files on the sd card.
Opening and appending to these files was fast and easy.
When file 104 was open for the first time it took a couple of seconds.
I then sent the L command and received !00
ALFAT then freezes with active and spi_busy high.

this extra delay caused a place in the code, which did not have the standard 4us between reads and write, to lock up the ALFAT.

Put in a delay and now it is not locking up.

Is there any way to fully synchronize with ALFAT and not use delays?

spoke too soon.
Still locks up.
Even with incredibly long delays of 200us instead of 4us.

still appending already existing files.
Locks up when a file that doesn’t exist is created with over one hundred files in the directory.

@ thombus -

How about if you delete all files and make a new file on SD?

As I know ALFAT has one problem, is accessing slower if there a lot of files on SD.