This was hoisted out of the FindInFiles code, since it seemed generally useful (not specific to FindInFiles) and at one point I thought I needed it in multiple places. (Not sure if that's still true, but it seems like a good thing to have available.)