Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • I know this is impossible under Linux. I don't know about Solaris. Commented Apr 4, 2012 at 23:43
  • The tail of /proc/PID/fd trick in the link @Gilles left might help you copy the contents out, but i suspect you'll no longer be able to re-link the file as with linux. Commented Apr 5, 2012 at 5:54
  • @dbenhur, there is no need to relink. You can use tail -c +1 -f /proc/pid/fd/num > /logfile to keep the original file (name) in sync with is active file descriptor data. The issue with this solution is that, especially with buffered output but not only, you'll likely miss the last lines when the original writing process dies. Commented Apr 7, 2012 at 13:01