Selectable buffer for OpenFileRequester

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Selectable buffer for OpenFileRequester

Post 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.
Last edited by netmaestro on Fri Oct 27, 2006 9:15 pm, edited 2 times in total.
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post 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.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post 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.
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

Hmm.

As an optional parameter (as mentioned) it sounded like a good idea, and still does. Or am I missing something?
Dare2 cut down to size
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post 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.
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post 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.
Dare2 cut down to size
Post Reply