in reply to Giving status of a file..

Of course, you can't be assured that pid 45872 is the same now as it was 5 minutes ago. What is to say that the process that you were trying to keep track of didn't exit, and a new one took it's place? Based on your description, you will incorrectly judge your process to still be running. Bad mojo indeed. Depending on what you're doing, you may want to take a look at fork in conjunction with flock to fork off a bunch of children that write to a common log file. They can log their own births and deaths. I recently used this trick to query off of a partitioned database, and I must say that it worked well.