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