Message-ID: From: Shawn Hargreaves To: djgpp AT delorie DOT com Subject: Re: Allegro datafiles and binary data Date: Tue, 18 Jan 2000 16:28:46 -0000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Reply-To: djgpp AT delorie DOT com Matt Firewalker writes: > If I were to place a binary file named foo.255 (the extension > doesn't matter, or does it?) Extensions are used by the dat utility to guess what type of object you are trying to import, and by the grabber to filter which files are displayed by the selector when importing into objects of a known type. But the dat utility has options to override the default guessing of file types, and grabber will list all files when importing into an object of unknown type like raw binary data. > into a Allegro datafile, and that binary file had a single string > (e.g. "Big things"), how would I load that string into a char > pointer or object? You generally don't want to copy the data somewhere else: the datafile system has already loaded it into memory for you (that's the whole point of using a datafile, after all!) so it's better to just use the existing copy. In the case of a binary data object, the dat field points to the data, and the size field points to the size. eg. char *my_data = (char *)datafile[objectnum].dat; for (i=0; i