offsetting a file

Blitz3D Forums/Blitz3D Programming/offsetting a file

DH(Posted 2006) [#1]
Is there a efficient way to offset a file (say put an extra few bytes at the begining) without having to read in the entire file and write it all back out?


octothorpe(Posted 2006) [#2]
'Fraid not, sorry.


DH(Posted 2006) [#3]
arg, this is where loading from a bank would come in handy....


octothorpe(Posted 2006) [#4]
Why? Banks, strings, files, and arrays all work the same way: if you need to add data to the beginning, the entire contents need to be moved forward.


DH(Posted 2006) [#5]
because this is to protect the contents of the file from pirating.

Normally, I would use a pak file. But its so crappy that I have to read in from the pak, save out, read in with blitz, then delete the temp..

If I could just load a file from a bank in blitz (say an image), then I could create a pak, load the file from the pak, and then use blitz to load it from the bank (never having to save it out again and reload it in again with blitz).

It may be small inconvienance with a 5 k file, but when your loading 20 5k files, all that disk access gets expensive and time consuming.

Thats why :-)


octothorpe(Posted 2006) [#6]
What does all that have to do with inserting bytes at the beginning of a file?


DH(Posted 2006) [#7]
Why?


octothorpe(Posted 2006) [#8]
Who is Spain?
Why is Hitler?
When is right?
Where are the Snowdens of yesteryear?


octothorpe(Posted 2006) [#9]
Argh. This is where pixel shaders would come in handy...