根据字符串路径确定C中是否存在文件

jam*_*tha 1 c

我有一个C字符串,我想用来打开该文件.如何确定文件是否存在?

Adr*_*ish 5

使用名为access()的函数

if(access(file_path, F_OK)==0)
    //file exists
else
    // file does not exists
Run Code Online (Sandbox Code Playgroud)