in reply to Re: launch long running background program and watch final progress
in thread launch long running background program and watch final progress
Update: I suppose also if you opened the file for read, then while(<FILE>)... will cause a program pause in the OS waiting for the next line to appear. You can examine each line waiting for the right msg to be written. Of course this could "deadlock" if the if the other program hangs. But if it dies and file closes, then you should get an EOF. The basic rationale behind these 2 ideas is not burn a lot of Mips waiting for something that itself is burning a lot of Mips where your "watcher" slows things down. I haven't tested, but I don't think you get an EOF if somebody else has the file open for "write". I have used inotify before and that will work.
Update: eatingmyownwords = I now think that that this won't work unless you are using some sort of trick like Tee and reading from a pipe which is left open. I think you get EOF when you reach the current extent of text in the file whether it is open or not for additional writes - that's what tail does.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: launch long running background program and watch final progress
by Anonymous Monk on Apr 22, 2016 at 19:29 UTC | |
by Marshall (Canon) on Apr 22, 2016 at 20:02 UTC |