PhysFS reads/writes result "access denied"
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
Hey cool, I made the same modification a while ago ;)
You need ot set the PhysicsFS write directory in your app:- PHYSFS_setWriteDir
You need ot set the PhysicsFS write directory in your app:- PHYSFS_setWriteDir
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]
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]
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:
(data.c_str() returns exactly the file I read)
This...
...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.
Can you show how you did it?
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 evolutional
Hey cool, I made the same modification a while ago ;)
Can you show how you did it?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement