How to write PHYSFS_file and Save

531 Views Asked by At

I am working with PHYSFS lib and am having some problems.

problems:

1 - is there any way that after I use the method

PHYSFS_file* filew = PHYSFS_openWrite(fileName.c_str()); 

I change the filew to READ?

2 - How do I do to save the file, for example I used the method PHYSFS_write need and saves it in a different file, how I do it.

3 - I would like to add a word at the beginning of the file, I'm trying this:

std::string str = "TESTS";
char *data = str.c_str();

PHYSFS_file* filew = PHYSFS_openWrite(fileName.c_str());
PHYSFS_write(filew, data, strlen(data), 1);
PHYSFS_close(filew); 

But I'm not having good results.

Thank you for your help.

0

There are 0 best solutions below