Thank you Tobias - the counter is a great idea! Also the use of flen(\name$)!! How could I forget about flen? I am using it in other parts of my program!tofro wrote: Sun Mar 09, 2025 4:20 pm
What I did first, was introduce a call counter in your code (i.e. count recursive calls of CalcDirSize). With your original code and your set data space of 96k, it managed to reach like 380 calls before running out of data space.
Then I made the following changes to your code:(I think that should do roughly the same as your code)Code: Select all
REMark Line 8700 removed (b$ = MDHEADR$(newname$) REMark Line 8800 removed (x = LONGINTEGER (b$(1 TO 4))) 8810 x = FLEN (\fname$) : REMark added, should do basically the same as the above
And the code could happily do 900 calls and more with the same data space size set as above (and ran through even my longest directory trees with no problem whatsoever).
WIth flen and dataspace 64k the test program happily does at least 1629 calls without any issues! (The largest win drive I have "only" has 1629 directories)
Next step, after Per updates the toolkit, is to check which is faster: MDHeader or flen