I'm a game developer using Torque (garagegames.com). I don't know much about C++, but when someone created a resource to add tinyXML to the code, I added it in. It worked great!
But now I ran into a little problem. When I open an XML file, and try to write to that XML file after I read it... I can't. The write fails every time, untill i close the application and try again. The file is locked. Is this something related to tinyXML, or is this specific to the Torque implementation? What could be wrong? Why would the files stay locked after reading them in?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is nothing TinyXML-specific about that problem. Rather its a C/C++ or platform-specific issue.
When you opened the file, did you open it with read and write access or just read? After you read the contents did you close and re-open to write to it, or open/rewind/write?
Just out of interest, what language(s) do you write games in if its not C++?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The author of the Torque resource fixed the problem. The file wasn't closed after read.
And to answer your question. I script my games in whatever script language is supported by the engine I use. In this case that's Torque script (which is rather basic, but it gets the job done quickly).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-07-05
And hows was this fixed? I keep a document open for a project file in my software (C++). The FILE* used in TiXml is not stored and never closed. Eh?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
TinyXML does not open or close streams that are passed to TinyXML (C++ iostreams or C FILE*). It is completely up to the host application to manage the streams.
lee
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-07-10
I recommend removing LoadFile(const char*.... because that method is included in TiXml and there is no way to close it if that is used, or it should be rightly noted in documentation. Other than this the library is working great.
I am opening and closing my own file now.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
+1. I think force users to use FILE* and/or streams directly.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-07-11
I see it does close the file now. I overlooked this for a while. I much prefer the way I'm handling the file. I dont prefer to allow other apps write-access to the document while it's opened and possibly undergoing changes until its closed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm a game developer using Torque (garagegames.com). I don't know much about C++, but when someone created a resource to add tinyXML to the code, I added it in. It worked great!
But now I ran into a little problem. When I open an XML file, and try to write to that XML file after I read it... I can't. The write fails every time, untill i close the application and try again. The file is locked. Is this something related to tinyXML, or is this specific to the Torque implementation? What could be wrong? Why would the files stay locked after reading them in?
There is nothing TinyXML-specific about that problem. Rather its a C/C++ or platform-specific issue.
When you opened the file, did you open it with read and write access or just read? After you read the contents did you close and re-open to write to it, or open/rewind/write?
Just out of interest, what language(s) do you write games in if its not C++?
The author of the Torque resource fixed the problem. The file wasn't closed after read.
And to answer your question. I script my games in whatever script language is supported by the engine I use. In this case that's Torque script (which is rather basic, but it gets the job done quickly).
And hows was this fixed? I keep a document open for a project file in my software (C++). The FILE* used in TiXml is not stored and never closed. Eh?
TinyXML does not open or close streams that are passed to TinyXML (C++ iostreams or C FILE*). It is completely up to the host application to manage the streams.
lee
I recommend removing LoadFile(const char*.... because that method is included in TiXml and there is no way to close it if that is used, or it should be rightly noted in documentation. Other than this the library is working great.
I am opening and closing my own file now.
+1. I think force users to use FILE* and/or streams directly.
I see it does close the file now. I overlooked this for a while. I much prefer the way I'm handling the file. I dont prefer to allow other apps write-access to the document while it's opened and possibly undergoing changes until its closed.