Menu

files locked after load

Developer
anonymous
2007-01-09
2013-05-20
  • anonymous

    anonymous - 2007-01-09

    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?

     
    • Ellers

      Ellers - 2007-01-10

      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++?

       
    • anonymous

      anonymous - 2007-01-10

      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).

       
    • Anonymous

      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?

       
    • Lee Thomason

      Lee Thomason - 2007-07-09

      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

       
    • Anonymous

      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.

       
      • Ellers

        Ellers - 2007-07-10

        +1. I think force users to use FILE* and/or streams directly.

         
    • Anonymous

      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.

       

Log in to post a comment.