(b) is certainly a reasonable thing. I think the typical way one figures this out is just by walking up the path from the current directory looking for the file.