[Implemented] read ahead cache and flags for OpenFile()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

[Implemented] read ahead cache and flags for OpenFile()

Post by blueznl »

Code: Select all

OpenFile( <nr> , <name> [ , <flags> [ , <buffersize> ]] )
flags (optional):

#PB_FILE_READ
#PB_FILE_WRITE
#PB_FILE_SHARED
#PB_FILE_NOCACHE

and buffer (optional) sets the size of the read ahead buffer in memory (to speed up *reading* file access)

writing to the file (when opened for r/w) should either update the cache, force it to be refreshed on the next read instructions, or caching should not be allowed in combination with r/w

(why optional? you don't want the cache to give you old data when another program is writing into the file...)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )