Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Jumping in binary file

Author
Message
##GERI##
User Banned
Posted: 15th Oct 2005 20:33
Hi.

So i have a big data pack, that contains binary files.
I save the pointers in other file, so i know where start end ends the binary file in the package.

But how to jump to the starting byte of the file in the package?
If i read every byte before the pointer, its may tooks too long.

Hegycsúcsra szált a kesejûknek vénje. Társakat szólítja, õket hívogatja:
Kesejûim jöjjetek a völgybe, jóllakozni híres harcosokból!
Jóllakozni híres harcosokból, életükben lándzsaforgatókból...
Darkbasic MADPSP
19
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 15th Oct 2005 21:17
Binary does dbc work with binary?

Where i would like to be
http://www.portaventura.es
vid: http://english.rides.nl/attractie/info/525
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 15th Oct 2005 21:19 Edited at: 15th Oct 2005 21:24
There is no Seek command in DB Classic, nor in DBPro either I believe.

Instead, you can open the file to read and use Read Byte in a loop, discarding the values you don't need until you reach the byte you need.

Closing the file and re-opening it will set the pointer to the start of the file.

TDK_Man

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 15th Oct 2005 21:26
Quote: "Binary does dbc work with binary?"


Geri doesn't want to actually read binary data from a file. He's just talking about non-text files which are generally known as binary files.

TDK_Man

Darkbasic MADPSP
19
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 15th Oct 2005 21:32
ok cool

Where i would like to be
http://www.portaventura.es
vid: http://english.rides.nl/attractie/info/525
##GERI##
User Banned
Posted: 15th Oct 2005 21:38
so

i have a big package, and i mus get quickly to a position in the file.

or i have another idea... i split the hughe file to smaller files.

Hegycsúcsra szált a kesejûknek vénje. Társakat szólítja, õket hívogatja:
Kesejûim jöjjetek a völgybe, jóllakozni híres harcosokból!
Jóllakozni híres harcosokból, életükben lándzsaforgatókból...
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 15th Oct 2005 21:51
Quote: "so

i have a big package, and i mus get quickly to a position in the file."


I just started an old project I never finished in Quickbasic and about 10 minutes in I discovered Darkbasic's limitations on file opening. In Quickbasic I could open a file as binary to read and/or write files anywhere in the file. Darkbasics "open file to write" made me sick when I saw that the file cannot exist for that command to work. I'm doing experiments to try to give me the same functionality as Quickbasics open command. When I get it working i'll let you know.
##GERI##
User Banned
Posted: 15th Oct 2005 22:07
ok. Then i split the big file to small (~15 Mbyte) files...

Hegycsúcsra szált a kesejûknek vénje. Társakat szólítja, õket hívogatja:
Kesejûim jöjjetek a völgybe, jóllakozni híres harcosokból!
Jóllakozni híres harcosokból, életükben lándzsaforgatókból...

Login to post a reply

Server time is: 2025-05-22 13:46:04
Your offset time is: 2025-05-22 13:46:04