Click here to Skip to main content
15,921,716 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i am making a dbms project in c for which i want to check file doesnt exist in that location.

What I have tried:

i try to open file with "r" in fopen but it creates new file
Posted
Updated 5-Apr-16 5:08am

You may use the access[^] function of the standard C library (with mode F_OK).

However, trying to open a file for reading should not create the file and can be also used to check if a file exists.
 
Share this answer
 
v2
Have a look at this [^] link, it may contain what you are looking for.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900