Page 1 of 1

Selectable buffer for OpenFileRequester

Posted: Sat Oct 14, 2006 11:17 am
by netmaestro
Currently PB is allocating around 2k for this, which is usually enough. However, some apps will require the ability to select whole folders, which could have a couple thousand files in them. If the buffersize defaulted to the current level but an optional parameter was provided to increase it, that would round out the features of the commnand nicely. imho.

Posted: Sun Oct 15, 2006 4:02 pm
by Rescator
Actually, I suspect Fred will follow the M$ advice.

This means PureBasic will automatically allocate a large enough buffer if the default one is too small.

Since this would only happen when a LOT of files are selected and it's a fast thing to do,
there should be no noticable slowdowns.

Setting it manualy (even if it's optional) could cause headaches if too small,
letting PB handle it all it'self would be much better.
Also, I assume Fred will use something similar to ReAllocateMemory internally so memory use/allocation would be to a minimum as well.

Posted: Mon Oct 16, 2006 11:32 am
by netmaestro
Yes, the approach taken by the PB team is better than my feature request. Mods: you won't hurt my feelings if you delete this thread, there's really no more need for it.

Posted: Mon Oct 16, 2006 1:01 pm
by Dare
Hmm.

As an optional parameter (as mentioned) it sounded like a good idea, and still does. Or am I missing something?

Posted: Mon Oct 16, 2006 8:04 pm
by netmaestro
Yes, I believe the way Fred has dealt with it in the new lib is better in that it will handle any required buffersize automatically. It starts with a small one, and the requester is hooked so that it can catch itself failing on a buffer_too_small error and resize the buffer as required. Perfectly seamless and doesn't need another parameter. So this request is obsolete.

Posted: Mon Oct 16, 2006 11:02 pm
by Dare
Okay. Re-read everything here and guess what? - I think I understand! :) So yes, with it all internalised by PB, it is good.