simplexml_load_file() and not releasing XML files

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jeff00seattle
Forum Commoner
Posts: 66
Joined: Sat Feb 28, 2009 3:27 pm

simplexml_load_file() and not releasing XML files

Post by jeff00seattle »

Hi

Sometimes I have a problem with simplexml_load_file() where it does not release its hold of an XML file after it is read.

In other words, after running a PHP program with simplexml_load_file() reading foo.xml, I cannot delete foo.xml because it is still being held by php.exe, and I am assuming the culprit is simplexml_load_file().

Is there a way to assure that simplexml_load_file() releases it hold on an XML file after I have completed traversing its generated tree of simple xml elements?

Thanks

Jeff in Seattle
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: simplexml_load_file() and not releasing XML files

Post by requinix »

If unsetting the variable doesn't work, load the file into a string and load it from that.
Post Reply