Given the path, is there a way to find out whether the file exists without opening the file?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The most efficient way is
accesswith theF_OKflag.statalso works but it’s much heavier weight since it has to read the inode contents, not just the directory.