Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: xml.DomDocument Load() function locking file...?  (Read 14101 times)
David H.
Posts: 158


« on: November 30, 2010, 11:56:30 am »

If you run the following program using v2.21.10 on Windows:-

Code
  1. IMPORT xml
  2. IMPORT os
  3.  
  4. MAIN
  5.  
  6.    DEFINE any_errors SMALLINT
  7.    DEFINE doc        xml.DomDocument
  8.  
  9.    LET doc = xml.DomDocument.create()
  10.    CALL doc.load("h:/test.xml")
  11.    CALL os.Path.delete("h:/test.xml") RETURNING any_errors
  12.    DISPLAY "File Exists (Try1)? ",os.Path.exists("h:/test.xml")
  13.    LET doc = NULL
  14.    CALL os.Path.delete("h:/test.xml") RETURNING any_errors
  15.    DISPLAY "File Exists (Try2)? ",os.Path.exists("h:/test.xml")
  16.  
  17. END MAIN
  18.  
  19.  

You get the following output:-

File Exists (Try1)?           1
File Exists (Try2)?           0

My question is should Load() still be locking the file after it has completed? For me it should not but I just thought I'd mention it...

Regards,

David
Sisavanh S.
Four Js
Posts: 80


« Reply #1 on: November 30, 2010, 12:24:53 pm »

Hi David,

It is a known issue fixed in 2.30:
17718 - Loading a XML file doesn't close the file on disk until the DOM builder has been released

As you have noticed, the workaround is to set the reference to the document to NULL.

Thanks for reporting.

Many regards,
Sisa.
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines