Advertisement

Opening files in allegro

Started by March 02, 2001 02:45 PM
0 comments, last by Tsu 23 years, 11 months ago
Why doesnt this work:
  
#include <stdio.h>
#include <allegro.h>

DATAFILE *a_datafile;
FILE *a_file;
FILE *another_file;

main(){
  //..

  
  a_datafile = load_datafile("bob.dat");
  a_file = fopen (a_datafile[text].dat,"r");
  another_file = fopen ("bob.txt","r");
  
  //..

}
  
in "bob.dat" (created using the grabber utility), config.txt is of type "TXT" (i went ''other'' and typed in ''TXT'') a_file doesnt work another_file does they both load the same file, only one is in a datafile... why doesnt it (a_file) load anything?
Once you''ve loaded the datafile, you''ve done all the loading you need to do, so effectively the text file is already "opened"... it''s the same with bitmaps, samples, etc etc, hence why the load fails... epsecially as the text in the datafile isn''t actually a file itself like bob.txt, it''s just text within a file.

Insomnia
Insomnia

This topic is closed to new replies.

Advertisement