Answer the question
In order to leave comments, you need to log in
How to read a text file from a zip archive using PHYSFS?
PHYSFS_init(NULL);
PHYSFS_addToSearchPath(filename.toLatin1(), 1);
char* myBuf;
PHYSFS_File* myfile;
myfile = PHYSFS_openRead("readme.txt");
if (myfile)
{
myBuf = new char[PHYSFS_fileLength(myfile)];
int length_read = PHYSFS_read(myfile, myBuf, 1, PHYSFS_fileLength(myfile));
PHYSFS_close(myfile);
qInfo(myBuf);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question