Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on How to determine access to file within the C and C++ forums, part of the Software Development category; 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 ...
|
|||||||
|
|||
|
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?
|
| Sponsored Links |
|
|||
|
Re: How to determine access to file
In C programming there is UNIX system call named as access() to achieve the purpose stated by you.
The syntax of the function access () is as follows: int access(char *path, int mode) This determines the accessibility of file in the pointed pathname for the mode as defined. The return value of the function access () is 0 if the operation is successful. The function returns -1 in case of error and also returns an errno to indicate the error. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Listen to any PDF file!!! | Shivanna | Geeks Lounge | 7 | 01-13-2009 09:18 AM |
| Database access using C program | fred | C and C++ | 1 | 07-13-2006 10:52 PM |
| Oracle and MS Access | Allan Paul | Oracle | 5 | 06-24-2006 01:53 PM |
| C Programming - File management in C | Lokesh M | C and C++ | 0 | 05-31-2006 04:35 PM |