stat, which is a different system call.
@xfix, in this case, I'm trying to determine what if anything went wrong. At the moment I am using exists as a crude approximation, but then I will not report the error properly. I'm translating code that I wrote in C, and getting the corner cases right was challenging in the first place. I could try opening for read, but then I'd need to identify first whether it is a directory or a file, which means yet more system calls (which also are slower than access). It's an error path so speed doesn't particularly matter, but code clarity does, and access tests what I want to test.