stat execution context and check it is a regular file or symlink