Open current viewed page for edit

I wrote this as a throw-away-feature for myself while porting a site from WP (lots of site-wide edits, not all of them scriptable):

If someone want to pick up the ball and turn it into a feature … It is very useful for massive copy-edits and such.

Very useful!

Would it be more generic just logging the latest served file to the standard output? (as part of the standard logging). Then we could redirect that output to a file with >log.txt, and use inotifywait to grab the last line of log.txt when it changes to open an editor with the file (as you do).

Sure that’s easy. The tricky part, as I noted, is the matching path vs filename.