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.

Dark GDK / File Functions not working

Author
Message
bloodmage2
15
Years of Service
User Offline
Joined: 14th Jun 2009
Location:
Posted: 13th Dec 2009 21:59
hello, i am attempting to create a sort of "resource file", i.e. put several objects into one large file, then access that file at the start, to tidy up my project folders. unfortunately, darkgdk does not seem to be able to actually write data into files. here is my test code.



-to the optimist, the glass is half full. to the pessimist, it is half empty, to the engineer, it is twice as big as it needs to be.
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 13th Dec 2009 22:32
Quote: "dbOpenToWrite
This command will open a file, ready for writing. The file must not exist or the command will fail. You can open up to 32 files at the same time, using a file number range of 1 through to 32.

Syntax
void dbOpenToWrite ( int iFile, char* szFilename ) "


You're creating it before calling dbOpenToWrite(), so it fails to open it.

The only option here is to use the C++ file methods or delete "Testconvert.lbr" before opening it to write.

Your_Health = (My_Mood == HAPPY) ? 100 : NULL;
bloodmage2
15
Years of Service
User Offline
Joined: 14th Jun 2009
Location:
Posted: 13th Dec 2009 22:35
*eye twitches, mouth agape*
so you are saying that there is no way to edit a file without deleting it? that seems a bit unnecessary and strange, but i'll try it.

-to the optimist, the glass is half full. to the pessimist, it is half empty, to the engineer, it is twice as big as it needs to be.
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 13th Dec 2009 22:59
Don't use the GDK file functions, they're crap, this sentiment generally goes for everything that you can otherwise do in C++ using any non-GDK library.

Login to post a reply

Server time is: 2024-11-20 07:31:25
Your offset time is: 2024-11-20 07:31:25