Yes, I totally agree that this is something that may be useful and perhaps requires more thoughts (like how to handle directories in the middle of the path) and definitely belongs to stdlib (once approved). I just put it here so that I'd have a place to start with this thought. Let's think about it more and decide whether we suggest to extend stdlib or abandon this thought completely (but I still think it's useful).