places: avoid repeated stat calls for files

(integrated from trunk branch change 276da7c by Todd Whiteman <toddw@activestate.com>)