This topic is 4849 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I tried to make little modifications to TinyXML so it could use PhysFS for reading and writing but I all attempts to read/write result error "access denied". Sounds like Linux problem but I have Windows 2000. What am I doing wrong? Edit: Modified loading code

##### Share on other sites
Hey cool, I made the same modification a while ago ;)

You need ot set the PhysicsFS write directory in your app:- PHYSFS_setWriteDir

##### Share on other sites
Now I have set the write dir but still get error from PHYSFS_read. This time "Archive is read-only". Why am I getting this when I am trying to read a file?

Edit: Ok, it seems that this error comes from PHYSFS_setWriteDir but I can't still see why. The directory I'm trying to set write dir is not "read-only".

[Edited by - olberg on September 2, 2005 4:21:00 AM]

##### Share on other sites
I tried setting write directory to NULL this time. Now I think I have found where the problem is.

This part of my code does what it should do:
while(PHYSFS_read( file, buf, sizeof(char), 2048 )>0){	data += buf;}

(data.c_str() returns exactly the file I read)

This...
if(!Parse( data.c_str(), 0, encoding )){	LOG("Parsing failed.\nPHYSFS_getLastError: ");	LOG(PHYSFS_getLastError());	LOG("\n");}

...doesn't give any errors (I assumed from sources that it returns zero on error) but still TiXmlDocument doesn't contain anything.

If I try to load the .xml-file with TiXmlDocument::LoadFile it works perfectly but with my version it doesn't work. I pass the same file to Parse()-function but it doesn't seem to work.

Quote:
 Original post by evolutionalHey cool, I made the same modification a while ago ;)

Can you show how you did it?

1. 1
2. 2
3. 3
Rutin
13
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633700
• Total Posts
3013418
×