Hey, need your help.

I'm writing a php4 script that parses a XML file and flush()es to the screen after completeing a section.

here is the complex part:
When it reaches the end of file, it will sleep() until more data is added (then it will parse that and go back to sleep if eof) or if it sees a special xml tag telling it to quit.
How do I do this??

Thanks!! 🙂

    You should just cron this script to run every X minutes instead of trying to make it sleep.

      Thanks for your reply Tom,

      I'm really new to php, from your reply, I'm wondering if it is bad programming to have a script continusly running with sleep() commands in it?

      Because this file will be opened/closed many times and content being added to the tail (by an outside program), I need to keep track where in the file I was last, so when I reopen, I can seek to that part (i.e. store linenumbers?). What's the most efficient way to do this?

      thanks again.

        What are you doing, exactly? Is the xml in the php file?

          No xml is in a seperate file. Ok, after doing some testing, I realized that I don't need to open/close a file and keep track of where I was in the file. So that makes life a lot easier. I think I can figure the rest out. Thanks for your help.

            Write a Reply...