Is there any predefined function or command in C to determine whether the user say userid has access to a file or not. I want to perform this check and based on the result I want to give actions. How to achieve this?