File IO - File position?

BlitzMax Forums/BlitzMax Programming/File IO - File position?

Jim Teeuwen(Posted 2006) [#1]
Hello peeps.

Im in the process of writing a .3ds file loader for my bmax project.

Ive run into a little snag. While parsing the file, im looping through Chunks of data as they are defined in the 3ds file. Every so often though I have to skip chunks that are not required.

The way to do this is with a FilePos( ) function.
In C that would be: fseek(l_file, l_chunk_length-6, SEEK_CUR);

This progresses the Filepointer by (l_chunk_length-6) bytes from the current position. The standard FileIO in Blitzmax however does not have a FilePos o Seek method.
Now I could write my own, but for that I will have to be able to retrieve the Current Pointer position in the file. After a bit of fiddling around, that has proven pretty unsuccessful.

Now before I go and create my own FileStream Type that allows me to maintain a FilePointer (oh the headache!), i'm curious if any of you know a quick solution?


N(Posted 2006) [#2]
stream.Seek( _to% )
stream.Pos%( )



Jim Teeuwen(Posted 2006) [#3]
doh ><